DIP 1017--Add Bottom Type--Final Review

Nicholas Wilson iamthewilsonator at hotmail.com
Tue Jan 22 10:23:09 UTC 2019


On Tuesday, 22 January 2019 at 06:57:24 UTC, Neia Neutuladh 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.

Indeed, hopefully we can convince Andrei to reverse the decision 
on DIP1015 at dconf.


More information about the Digitalmars-d mailing list