In the code below, the variable i is never increased above x+1. It seems the declaration inside the loop somehow overwrites i. (Note that the writeln() is only for demonstration purposes and has nothing to do with the bug.) import std.stdio; void run(fun...)() { fun[0](); } void main() { run!(delegate void() { for (int i = 0; i < 100_000; i++) { writeln(i); auto x = 0; // i never exceeds 1 } })(); }
*** This issue has been marked as a duplicate of issue 4246 ***
Actually bug 4246 is itself a duplicate of 1350. *** This issue has been marked as a duplicate of issue 1350 ***