https://issues.dlang.org/show_bug.cgi?id=15535
Issue ID: 15535
Summary: Emit error on "goto default" in final switch
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
This code compiles, but I think it shouldn't:
void main()
{
int i;
final switch(i) {
case 1: goto default;
}
}
When executed, the program immediately crashes.
Because a final switch cannot have a "default:" case, I think the compiler
error on this code.
--