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

--- Comment #38 from Sobirari Muhomori <[email protected]> ---
(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.

--

Reply via email to