[Issue 15195] DIP25: Member functions can leak local variables
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Mon Oct 12 14:46:27 PDT 2015
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15195
--- Comment #1 from timon.gehr at gmx.ch ---
The compiler actually allocates a closure (so unlike the other DIP25 bug
reports, there is no memory corruption here.)
I'm not sure what the intended behaviour is.
The closure is allocated even in the following case:
void foo()@nogc{
    int x;
    struct S{ int bar()@nogc{ return x; } }
    S s;
}
Error: function foo @nogc function allocates a closure with the GC
--
    
    
More information about the Digitalmars-d-bugs
mailing list