[Issue 969] New: 'this' needed for class member

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 16 10:05:07 PST 2007


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

           Summary: 'this' needed for class member
           Product: D
           Version: 1.006
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: maxter at i.com.ua


The compiler chokes on the code below with the error: need 'this' to access
member a'. Should it?

template TFoo(alias T)
{
        void foo()
        {
                writefln(T);
        }
}

template TBar(alias T)
{
        void bar()
        {
                TFoo!(T).foo();
        }
}

class Test
{
        int a;
        mixin TBar!(a);
}

void main()
{
}


-- 



More information about the Digitalmars-d-bugs mailing list