http://d.puremagic.com/issues/show_bug.cgi?id=1841
Don <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #2 from Don <[email protected]> 2010-07-27 00:03:36 PDT --- Here's a clearer test case. The second assert fails. Closure detection works correctly if you change the delegate literal to: return delegate int() { int x=heap; return nested_func(); }; --------------------- //import std.stdio; int delegate() Foo() { int stack; int heap=3; // writeln("&stack=",&stack," &heap=",&heap); int nested_func() { ++heap; return heap; } return delegate int() { return nested_func(); }; } void main() { auto z = Foo(); auto p = Foo(); assert(z()==4); // OK p(); assert(z()==5); // fails } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
