Bug 9263 – statement is not reachable when statement is reachable
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-03T03:36:00Z
Last change time
2013-01-03T19:20:49Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
deadalnix
Comments
Comment #0 by deadalnix — 2013-01-03T03:36:22Z
enum E : uint
{
A,
B,
}
private string foobar(E e)
{
final switch (e) with (E) {
case A:
return "A";
case B:
return "B";
}
}
The final switch is not reachable according to dmd.
Comment #1 by bearophile_hugs — 2013-01-03T04:09:39Z
A bit simplified. string, final, uint are not needed to show the problem:
enum Foo { A }
int main() {
Foo f;
final switch(f) with(Foo) {
case A:
return 0;
}
}
The with() statement has some problems.