import std.range; import std.stdio; void main() { X: foreach (l; stdin.byLine()) { switch(l.front) { case 'q': break X; default: } } } With latest git dmd: Internal error: s2ir.c 731
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/4db6e34c293d9a6c6a2afe750b13cbb8814409e5 Issue 9068 - fix compiler error when breaking from some labelled loops. Specifically, it affected loops that get implicitly wrapped into additional clauses, such as try/finally, causing the label to refer to another statement. https://github.com/D-Programming-Language/dmd/commit/adcdfd7bd0cdea8b0f79cef4a687cd4eb77b3c53 Merge pull request #1394 from dsagal/bug9068 Issue 9068 - fix compiler error when breaking from some labelled loops.
Tested on latest git HEAD dmd, Linux/64bit, confirmed fixed by above pull request.
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/2df2571896d647a6c9d32f754fd21bae1a70cd1e Move issue 9068 test to runnable/foreach5.d