https://issues.dlang.org/show_bug.cgi?id=5710

--- Comment #39 from timon.g...@gmx.ch ---
(In reply to Sobirari Muhomori from comment #38)
> (In reply to Martin Nowak from comment #34)
> > It's still challenging to implement all the IR gen for this.
> 
> BTW, looks like all the code generation was there for ages:
> 
> struct A
> {
>       int a;
>       int delegate() foo()
>       {
>               int b;
>               int bar()
>               {
>                       return a+b;
>               }
>               int delegate() d=&bar;
>               b=1;
>               return d;
>       }
> }
> 
> Here nested function `bar` accesses both stack variable `b` and member field
> `a` through single context pointer in delegate `d` as if it has two contexts
> - closure pointer and `this` pointer.

This is not the same thing. Here, one context is nested in the other.

--

Reply via email to