Bug 12380 – Wrong line number for type mismatch with enum .init assignment
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-03-16T01:56:20Z
Last change time
2022-12-10T13:56:37Z
Keywords
diagnostic, pull
Assigned to
No Owner
Creator
Andrej Mitrovic
Comments
Comment #0 by andrej.mitrovich — 2014-03-16T01:56:20Z
-----
enum E { a, b, } // L1
void main()
{
void* a = E.init; // L5
}
-----
$ dmd test.d
test.d(1): Error: cannot implicitly convert expression (cast(E)0) of type E to void*
Should be:
test.d(5): Error: cannot implicitly convert expression (cast(E)0) of type E to void*
Comment #3 by andrej.mitrovich — 2014-05-22T09:43:52Z
I've found another test-case which wasn't fixed by this pull:
-----
struct vec2 { float x, y; }
enum winSize = vec2(1024, 768); // L3
void main()
{
int x = winSize.x; // L7
}
-----
test.d(3): Error: cannot implicitly convert expression (1024.00) of type float to int