Annoyance with new integer promotion deprecations

Steven Schveighoffer schveiguy at yahoo.com
Mon Feb 5 22:42:59 UTC 2018


On 2/5/18 3:21 PM, Steven Schveighoffer wrote:

> IMO, you shouldn't have to cast to int first, if you are just casting 
> back to byte:
> 
> int x = cast(byte)-b;
> 
> assert(x == -128) // both with and without intpromote
> 
> But I don't know if the compiler can be made to see this eventual result 
> and not output the deprecation. Either way, the deprecation is still not 
> a full error.

It shouldn't output the deprecation I think: 
https://issues.dlang.org/show_bug.cgi?id=18380

-Steve


More information about the Digitalmars-d mailing list