DIP 1017--Add Bottom Type--Final Review
Chris M.
chrismohrfeld at comcast.net
Tue Jan 22 15:11:58 UTC 2019
On Tuesday, 22 January 2019 at 06:57:24 UTC, Neia Neutuladh wrote:
> On Tue, 22 Jan 2019 06:29:41 +0000, Tobias Müller wrote:
>> [...]
>
> Point of pedantry: bool is an integer type according to the
> type specialization rules, a more specific subtype of 'int'. It
> can participate in some arithmetic expressions, though it omits
> things like ++ and +=.
>
> So you can write things like:
>
> i = i + true | ((true + true) ^^ (true + true + true) ^
> false);
>
> And this code uses the bool overload:
>
> void foo(bool b) { writeln("bool"); }
> void foo(short b) { writeln("ubyte"); }
> foo(cast(ubyte)0);
>
> I'm not sure anyone but Walter thinks this is a good idea.
I'm still salty about DIP1015
More information about the Digitalmars-d
mailing list