[Issue 1225] New: Super Class method hides the global template from mixin

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed May 9 08:04:52 PDT 2007


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

           Summary: Super Class method hides the global template from mixin
           Product: D
           Version: 1.014
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: davidl at 126.com


import std.stdio;
template dup(T){
    T dup(){
    auto c=new T;
    foreach(i,x;T.tupleof)
    {
        c.tupleof[i]=x;
        writefln(`tupleof `,i);
    }
    return c;

    }
}
class baseclass
{
    mixin dup!(baseclass);
    void method(){printf("a.method\n");}
}
class deriveclass:baseclass
{
    mixin dup!(deriveclass);
    int j;
    void method(){printf("b.method\n");}
}
void main()
{
    deriveclass mybinstance = new deriveclass;
    mybinstance.dup;
}
compiler complains:
testclass.d(21): mixin dup isn't a template


-- 



More information about the Digitalmars-d-bugs mailing list