Deprecate implicit `int` to `bool` conversion for integer literals

Steven Schveighoffer schveiguy at yahoo.com
Tue Nov 14 23:56:58 UTC 2017


On 11/14/17 6:48 PM, Andrei Alexandrescu wrote:
> On 11/14/2017 06:05 PM, Michael V. Franklin wrote:
>> On Tuesday, 14 November 2017 at 13:54:03 UTC, Steven Schveighoffer wrote:
>>
>>> IMO, no character types should implicitly convert from integer types. 
>>> In fact, character types shouldn't convert from ANYTHING (even other 
>>> character types). We have so many problems with this.
>>
>> Is everyone in general agreement on this?  Can anyone think of a 
>> compelling use case?
> 
> No, that would be too large a change of the rules.

All it means is that when VRP allows it, you still have to cast. It's 
not that large a change actually, but I can see how it might be too 
disruptive to be worth it.

> FWIW 'a' has type 
> dchar, not char. -- Andrei
> 

No:

pragma(msg, typeof('a')); // char

-Steve


More information about the Digitalmars-d mailing list