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.
Comment #2 by k.hara.pg — 2013-01-03T07:35:56Z
Comment #3 by github-bugzilla — 2013-01-03T11:09:47Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9e58954f0303064d4aa413011085ce838d00f993 fix Issue 9263 - statement is not reachable when statement is reachable https://github.com/D-Programming-Language/dmd/commit/539b54ac7c423f53966384bd572ec4db10c6da0e Merge pull request #1431 from 9rnsr/fix9263 Issue 9263 - statement is not reachable when statement is reachable