www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20612] New: alias overload set cause mixin overload function

https://issues.dlang.org/show_bug.cgi?id=20612

          Issue ID: 20612
           Summary: alias overload set cause mixin overload function
                    strange behavior
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: yunwind msn.com

import core.stdc.stdio;

class T {
        void test() {
                printf("t\n");
        }
}

class T1 : T {
        alias T.test test;
        mixin Foo;
}

template Foo() {
        override void test() {
                printf("t1\n");
        }
}

class T2 : T1 {
        override void test() {
                printf("t2\n");
                super.test();
        }
}

void main()
{
        auto t2 = new T2;
        t2.test(); //output t2, t

        auto t1 = new T1;
        t1.test(); //output t1
}

--
Feb 26