http://d.puremagic.com/issues/show_bug.cgi?id=6816

           Summary: [CTFE] nested function can't access this
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: d...@dawgfoto.de


--- Comment #0 from d...@dawgfoto.de 2011-10-16 00:20:10 PDT ---
struct S
{
    size_t foo()
    {
        size_t nested()
        {
            return value + 1;
        }
        return nested();
    }

    size_t value;
}

enum s = S().foo();

----

It seems as if checking callers in ThisExp::interpret would work.

    while (istate && !istate->localThis)
        istate = istate->caller;

Errors for a wrong 'this' will/should be detected during semantic.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to