[Issue 2308] New: CTFE crash on foreach over nonexistent variable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 23 09:30:36 PDT 2008


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

           Summary: CTFE crash on foreach over nonexistent variable
           Product: D
           Version: 1.034
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: matti.niemenmaa+dbugzilla at iki.fi


bool foo() {
        foreach (x; xs) {}
        return true;
}

static assert (foo());

Compiling the above gives the following, after which DMD crashes:

asdff.d(2): Error: undefined identifier xs
asdff.d(2): Error: cannot infer type for x


-- 



More information about the Digitalmars-d-bugs mailing list