Different situation is for such C# loop:
---
for (int i = 0; i < funcs.Length; ++i)
{
int t = i;
funcs[i] = new MyFunc(() => System.Console.WriteLine(t));
}
---
where "t" is local for scope. Here C# behaves correctly, but D doesn't. This D loop
---
foreach(i; 0 .. 5) {
int t = i;
functions ~= { printf("%d\n", t); };
}
---
prints "4" five times. It's Issue 2043:
http://d.puremagic.com/issues/show_bug.cgi?id=2043