On Tuesday, 23 July 2013 at 13:37:26 UTC, JS wrote: > It is wrong to use a local variable inside a delegate when the > delegate is called outside the scope of that variable. This > should technically be an error as it is undefined behavior. AFAIK it is defined in D, compiler should move it to heap if it is captured by delegate and gets out of scope.