If you have a enum like so:
enum <uint16> {
b6 = (1 << 6),
b7 = (1 << 7),
b8 = (1 << 8)
} x <edit=flags>;
Enabling b6
will work fine, whereas enabling b7
will give an error that the value is out of range. Enabling b8
will just silently fail. Additionally, enabling b6
only and trying to disable it (so that the value of x
is 0) will also give an out of range error.
If you change the type from uint16
to int16
, enabling b7
will also enable b8
(and all bits higher), as if it was an 8-bit signed integer with the sign bit enabled being assigned to a 16-bit signed integer.
This behaviour has been confirmed in v16.0beta2.