Bug 18736 – constructor calls allowed after case labels

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-04-06T03:36:47Z
Last change time
2018-04-16T11:56:17Z
Keywords
accepts-invalid
Assigned to
No Owner
Creator
Walter Bright
See also
https://issues.dlang.org/show_bug.cgi?id=18688

Comments

Comment #0 by bugzilla — 2018-04-06T03:36:47Z
Delegating constructor calls are not allowed after labels, but case labels and default labels should also count as labels. class A { this(char c) { } this(int i) { switch (i) { case 1: break; default: break; } this('c'); // should give error } }
Comment #1 by bugzilla — 2018-04-06T04:52:48Z
Comment #2 by github-bugzilla — 2018-04-16T11:56:17Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/15f525620895727147cf12e33596ae1a2d3ffa45 fix Issue 18736 - constructor calls allowed after case labels https://github.com/dlang/dmd/commit/49268c71adbc6631013d32c70152fd665d70760c Merge pull request #8143 from WalterBright/fix18736 fix Issue 18736 - constructor calls allowed after case labels