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

           Summary: static nested class can reference outer scope by
                    template instantiation
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: timon.g...@gmx.ch


--- Comment #0 from timon.g...@gmx.ch 2012-06-10 13:39:50 PDT ---
class D{
    int x;
    template bar(){
        int foo(){
            return x;
        }
    }
    static class C{
        int foo(){
            return bar!().foo();
        }
    }
}

C does not have a reference to the enclosing context, therefore the call to
bar!().foo is invalid.
DMD 2.059 accepts the code.

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

Reply via email to