This is in DMD 1.071: $ cat t.d void f() { for (int i = 0; i < x.length; i++) { } } $ dmd -c t.d t.d(2): Error: undefined identifier x, did you mean function f? _error_ 0x8edf468 dmd: expression.c:1432: virtual dinteger_t IntegerExp::toInteger(): Assertion `0' failed. Aborted
An even simpler testcase: void f() { while (x.length) { } }
BTW, compiling DMD in "debug mode" hides the assertion :S
OK, it seems that only the makefile is broken, after rebuilding all DMD I can't reproduce the bug anymore. I guess some files weren't rebuilt after I updated the git repo and that's what was causing the problem.