https://issues.dlang.org/show_bug.cgi?id=23001
Issue ID: 23001
Summary: missing unreachable code warning with switch inside
switch
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: diagnostic
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
import std.stdio : writeln;
void fn()
{
switch (1)
{
default:
break;
{
writeln("never reached");
switch (1) { default: break; }
}
}
}
compile: dmd -w test.d
it will give the warning if the the switch after writeln() is commented out, or
if the block after break; is replaced with the two statements it contains
--