Bug 9358 – Compiler creates duplicate switch cases after an error
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-20T10:11:00Z
Last change time
2013-01-20T16:49:37Z
Keywords
diagnostic, pull
Assigned to
andrej.mitrovich
Creator
andrej.mitrovich
Comments
Comment #0 by andrej.mitrovich — 2013-01-20T10:11:22Z
void main()
{
double x;
switch (x)
{
case 1: break;
case 2: break;
default:
}
}
test.d(6): Error: 'x' must be of integral or string type, it is a double
test.d(8): Error: case must be a string or an integral constant, not 1
test.d(9): Error: case must be a string or an integral constant, not 2
test.d(9): Error: duplicate case 0 in switch statement
The last error message shouldn't appear.
Comment #1 by andrej.mitrovich — 2013-01-20T10:16:34Z