[Issue 827] Trying to break out of a labelled BlockStatement breaks out of a for loop at its beginning

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jun 23 15:10:33 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=827


bugzilla at digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX




------- Comment #2 from bugzilla at digitalmars.com  2008-06-23 17:10 -------
It works as spec'd, and you're right it is the same issue as 199. Won't change
behavior for the same reason. Note that if you write it as (inserting an if
statement):

import std.stdio;

void main() {
    block: if (1) {
        for (int i = 0; i < 10; i++) {
            if (i == 5) break block;
        }
        writefln("Within block");
    }
    writefln("Outside block");
}

it won't compile per the spec.


-- 



More information about the Digitalmars-d-bugs mailing list