[Issue 23546] New: bad error message for forward referenced member in enum
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Dec 10 13:04:21 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23546
Issue ID: 23546
Summary: bad error message for forward referenced member in
enum
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: minor
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: nick at geany.org
From: https://dlang.org/spec/enum.html#named_enums
enum C
{
A = B, // A = 4
B = D, // B = 4
C = 3, // C = 3
D // D = 4
}
This causes:
enumerr.d(6): Error: cannot implicitly convert expression `4` of type `int` to
`C`
Note A does not affect this bug.
Either:
* dmd should allow this
* dmd should give a better error message and the spec should be updated.
--
More information about the Digitalmars-d-bugs
mailing list