http://d.puremagic.com/issues/show_bug.cgi?id=8182
Summary: with a lazy struct parameter, the struct's destructor is called on the generated delegate Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: wrong-code Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: mailm...@nilsb.dyndns.org --- Comment #0 from Nils <mailm...@nilsb.dyndns.org> 2012-06-01 15:52:12 PDT --- $ cat test.d import std.stdio; struct S { int x = 42; ~this() { if(x != 42) writeln((*cast(S delegate()*) &this)().x); } } void lazily(lazy S) { } void main() { lazily(S()); } $ rdmd test.d 42 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------