While doing #5954 I noticed this behavior:
@[Flags]
enum Foo
Bar = -2
Baz
end
pp Foo::Bar.value # -2
pp Foo::Baz.value # -4
Is it intended? Or should this be an error (for flag enum at least) ?
If it should be an error, maybe we should also restrict enum flags to unsiged integer type (and default to UInt32 instead of Int32)
Maybe we can restrict them to being positive or zero.
@asterite I object. There are legitimate cases of constants enum members with minus values. See for instance http://gphoto.org/doc/api/gphoto2-result_8h.html.
@Sija we are talking about enum flags here, not generic constants
Most helpful comment
@Sija we are talking about enum flags here, not generic constants