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

--- Comment #0 from 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:
------- You are receiving this mail because: -------

Reply via email to