|Posted by Walter Bright|
in reply to Steven Schveighoffer
On 9/13/2021 1:35 PM, Steven Schveighoffer wrote:
> To reiterate, intpromote is going to require lots of casts, most of which wouldn't change any behavior that is currently happening.
Intpromote has been there for many years, it hasn't caused a big problem.
> The cases where the behavior is different is going from 8 or 16-bit integers to higher bit numbers. IMO, intpromote should focus on those, and leave the others alone.
The thing is, if b is a ubyte:
is supposed to be an int, not a ubyte. It's not just about getting the bits right.
> But fixing this problem doesn't mean we have to break all existing code for the purpose of busywork to insert casts to achieve the current behavior.
It needs to move to C behavior.
> I just realized, the deprecation doesn't even say how to replicate current behavior. It says to cast to int before applying the operator, but that's not what current behavior does, it's what the *new* behavior does. Typically, deprecations identify how to adjust your code so it continues to do the same thing. This does the opposite.
The message is about inuring your code so it will work as intended regardless of the switch setting.