You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following is an error:
```enum E : int;E e = E(4);```
enumbase.d(2): Error: cannot implicitly convert expression `4` of type `int` to `E`
Which is consistent with uniform construction because a base type instance does not implicitly convert to the enum type. But this compiles:
```struct S { this(int) {}}enum E : S;E e = E(2);```
However, an instance of S does not implicitly convert to E, so this is inconsistent.
The spec does not seem to mention enum construction with an argument list.
There is a test in dmd for issue 16346 to allow E(E.member), presumably for generic code.
The text was updated successfully, but these errors were encountered:
Nick Treleaven (@ntrel) reported this on 2024-11-09T16:35:12Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=24850
Description
The text was updated successfully, but these errors were encountered: