Bug 4100 – Break and continue to label should mention foreach
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-04-17T10:55:00Z
Last change time
2014-02-15T02:43:44Z
Keywords
spec
Assigned to
nobody
Creator
jlquinn
Comments
Comment #0 by jlquinn — 2010-04-17T10:55:19Z
Both break and continue can branch to a label, but the text only mentions for, while, and do loops. Foreach loops should also be included. Dmd supports it.
Comment #1 by ellery-newcomer — 2010-04-17T12:24:56Z
(In reply to comment #0)
> Both break and continue can branch to a label, but the text only mentions for,
> while, and do loops. Foreach loops should also be included. Dmd supports it.
It's mentioned just above the switch statement
Comment #2 by jlquinn — 2010-04-17T13:27:29Z
(In reply to comment #1)
> (In reply to comment #0)
> > Both break and continue can branch to a label, but the text only mentions for,
> > while, and do loops. Foreach loops should also be included. Dmd supports it.
>
> It's mentioned just above the switch statement
The text for ContinueStatement is:
If continue is followed by Identifier, the Identifier must be the label of an enclosing while, for, or do loop, and the next iteration of that loop is executed. It is an error if there is no such statement.
It doesn't mention foreach and it should. Ditto with BreakStatement.