[Issue 16521] Wrong code generation with switch + static foreach
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Mar 9 12:00:24 PST 2017
https://issues.dlang.org/show_bug.cgi?id=16521
Nemanja Boric <4burgos at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|accepts-invalid |
--- Comment #5 from Nemanja Boric <4burgos at gmail.com> ---
I don't agree that this code should error. This is a well known and common D
idiom (simple GH search shows examples in Phobos, such:
https://github.com/dlang/phobos/blob/master/std/algorithm/sorting.d#L1101), up
to the point that there are also merged switch/foreach loops constructs where
the label is applied to switch, so the `break` inside foreach would be
considered switch break.
--
More information about the Digitalmars-d-bugs
mailing list