Bug 6786 – Bad error message in a wrong usage of ^^ pow operator
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2011-10-07T15:45:00Z
Last change time
2012-10-20T18:20:19Z
Keywords
diagnostic
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2011-10-07T15:45:52Z
This is an example of wrong D2 code that produces a correct error message:
void foo(int x) {
enum int x2 = x;
}
void main() {}
DMD 2.056head gives:
test.d(2): Error: variable x cannot be read at compile time
This is similar wrong code:
void foo(int x) {
enum int x2 = x ^^ 2;
}
void main() {}
But here DMD 2.056head gives a less good error message:
test.d(2): Error: variable x is used before initialization
Comment #1 by andrej.mitrovich — 2012-10-20T18:20:19Z