Bug 12337 – Bad enum usage wrong error message line number
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-10T10:59:00Z
Last change time
2017-07-21T10:41:13Z
Keywords
diagnostic
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2014-03-10T10:59:47Z
This is wrong code:
enum Foo : ubyte { A, B }
void main() {
Foo x = Foo.A | Foo.B;
}
dmd 2.066alpha gives an error message on the wrong line:
test.d(1,20): Error: cannot implicitly convert expression (1) of type int to Foo
Comment #1 by dlang-bugzilla — 2017-07-21T10:41:13Z