With Github HEAD dmd I get: $ rdmd --force /tmp/test.d /tmp/test.d(3): Deprecation: integral promotion not done for ~foo, use '-transition=intpromote' switch or ~cast(int)(foo) /tmp/test.d(5): Deprecation: integral promotion not done for -foo, use '-transition=intpromote' switch or -cast(int)(foo) /tmp/test.d(6): Deprecation: integral promotion not done for -foo, use '-transition=intpromote' switch or -cast(int)(foo) To me it seems that line 5 should result in error since I am trying to coerce an int into a byte. void main() { // 1 byte foo; // 2 foo = ~foo; // 3 foo = ~cast(int) (foo); // 4 -- this should be an error but no foo = -foo; // 5 foo = cast(byte) (-foo); // 6 }
>> To me it seems that line 5 should result in error since I am trying to coerce an int into a byte. I meant line 4.
Why is this marked as a regression?
It's not an error because, by the magic of VRP (Value Range Propagation) no bits are lost.