https://issues.dlang.org/show_bug.cgi?id=5730
RazvanN <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED CC| |[email protected] Resolution|--- |FIXED --- Comment #6 from RazvanN <[email protected]> --- Today this code compiles succesfully and prints "destructor": struct S { ~this() { import std.stdio; writeln("destructor"); } } void main() { S s; enum error = __traits(compiles, { auto s1 = s; }); //static assert(!error); // line 1 } It seems that the compiler is able to allocate the closure and also track it with the gc. Closing as fixed. --
