[Issue 3159] New: Can't access member variables from templated nested member function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 9 10:28:20 PDT 2009


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

           Summary: Can't access member variables from templated nested
                    member function
           Product: D
           Version: 2.031
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: dsimcha at yahoo.com


struct Foo {
    uint number;

    void doStuff(uint num) {

        void doMoreStuff(T)(T num2) {
            number++;
        }

        doMoreStuff(num);
    }
}

test.d(7): Error: need 'this' to access member number

Also happens if Foo is a class instead of a struct.  Does not happen if
doMoreStuff() is a plain old function instead of a function template.

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


More information about the Digitalmars-d-bugs mailing list