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

           Summary: [CTFE] base class does not call overridden members
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: r.sagita...@gmx.de


--- Comment #0 from Rainer Schuetze <r.sagita...@gmx.de> 2011-12-20 07:05:44 
PST ---
module test;

class A
{
    int foo() { return 0; }

    int callfoo()
    {
        return foo();
    }
}

class B : A
{
    override int foo() { return 1; }
}

int test()
{
    A a = new B;
    return a.callfoo();
}

static assert(test() == 1);


Compiling with "dmd -c test.d" yields:
test.d(24): Error: static assert  (0 == 1) is false

If you use "a.foo()" instead of "a.callfoo()", the assert succeeds.

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

Reply via email to