Open
Description
basile-z reported this on 2024-07-25T18:00:53Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=24684
Description
For
```
enum A1 : int
{
a,
b,
}
enum A2 : A1
{
c, // does not require +1
d, // requires + 1
}
```
The definition of A2.d causes the error
> /tmp/temp_7F4942E9C090.d(10,5): Error: comparison between different enumeration types `A2` and `A1`; If this behavior is intended consider using `std.conv.asOriginalType`
which makes no sense.
In fact the real problem is that `A2.d` violates the specification 18.1.5 (https://dlang.org/spec/enum.html#named_enums), specifically _"it is given the value of the previous EnumMember + 1_".
In consequence a better message would be that `d` value cannot be automatically defined because the base type does not support increment.