Heavily reduced test-case (so the snippet might not make sense), originally from CairoD: struct ItemRange { @property int front() { return 0; } } void main() { ItemRange range; foreach (index, element; range) { } } --------------------------- dmd.exe - Application Error --------------------------- The instruction at "0x0045b065" referenced memory at "0x00000010". The memory could not be "read". Click on OK to terminate the program Click on CANCEL to debug the program --------------------------- OK Cancel --------------------------- Using DMD 2.055 on XP32. Removing index from foreach prevents the crash: foreach (element; range) { }
*** This issue has been marked as a duplicate of issue 6723 ***