Why does intpromote spew warnings for ~ operator?

Steven Schveighoffer schveiguy at gmail.com
Mon Sep 13 17:49:25 UTC 2021


On 9/13/21 11:38 AM, H. S. Teoh wrote:
> On Sun, Sep 12, 2021 at 10:14:03AM -0400, Steven Schveighoffer via Digitalmars-d wrote:
> [...]
>> ```
>> onlineapp.d(11): Deprecation: integral promotion not done for `~x`, use
>> '-preview=intpromote' switch or `~cast(int)(x)`
>> onlineapp.d(11): Deprecation: integral promotion not done for `~x`, use
>> '-preview=intpromote' switch or `~cast(int)(x)`
>> Number of affected cases: 0
>> ```
> [...]
> 
> The integer promotion situation in D is a mess.  My personal preference
> is:
> 
> --------
> module nopromote;

Sure, just like *everyone* uses std.utf.byCodeUnit to avoid 
autodecoding, right?

-Steve


More information about the Digitalmars-d mailing list