int/longRe: DIP 1015--removal of integer & character literal conversion to bool--Final Review

Nicholas Wilson iamthewilsonator at hotmail.com
Sun Sep 16 03:36:09 UTC 2018


On Sunday, 16 September 2018 at 01:47:33 UTC, Mike Franklin wrote:
> On Friday, 14 September 2018 at 23:08:34 UTC, Nicholas Wilson
>> The only thing I think is missing is a flag to accelerate the 
>> process s.t. the examples
>>
>> f(E.a);
>> f(E.b);
>> g(a - b);
>>
>> can be made to call their int/long overloads straight away. 
>> But otherwise, er, no. A resounding yes with a small request 
>> to make the transition faster!
>
> I'm not too keen on adding a compiler flag, because then I have 
> to worry about deprecating the compiler flag.  I don't know if 
> the bugs that this DIP fixes are serious enough to justify it.  
> I'd be happy to add it if others are willing to voice their 
> support for it, demonstrating sufficient demand.  Or, I suppose 
> I could add it as an option for Walter and Andrei to approve or 
> reject on judgement day.
>
> Mike

Its more about dealing with the deprecation warning.

With the current specification I can tell the compiler I want the 
old behaviour with a cast. I should be able to tell the compiler 
that "Yes, I wan't this new behaviour. Please don't warn me about 
it.", once I have verified that my code is correct under the new 
behaviour.

Without it, I get a (possibly quite a lot of) deprecation 
warnings and I have to insert a cast to the corresponding type, 
e.g. f(cast(int)E.a)/g(cast(long)(a - b)), to verify the 
behaviour under the new system and silence the deprecation 
warning (absolutely necessary if using `-de`). Then I have to 
delete them after stage 2, but what if I want to support older 
compilers? Well then I have to wait until they are sufficiently 
old enough.



More information about the Digitalmars-d mailing list