[Issue 18495] Integral promotion for a ~ operator

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 22 15:13:06 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18495

--- Comment #1 from Kirill <mrkirushko at ya.ru> ---
Of course if I do add "-transition=intpromote" as advised by the compiler, it
just gives an error: "cannot implicitly convert expression `~cast(int)d1` of
type `int` to `ubyte`. Fixing this requires to add some ugly looking code like
" d2 = 0xFF & ~d1; " ore something even worse like " d2 = cast(ubyte) ~d1; ".
This just can not be right.

--


More information about the Digitalmars-d-bugs mailing list