December 20, 2011
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: nobody@puremagic.com
        ReportedBy: r.sagitario@gmx.de


--- Comment #0 from Rainer Schuetze <r.sagitario@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: -------
December 21, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=7144


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> 2011-12-21 15:20:47 PST ---
https://github.com/D-Programming-Language/dmd/commit/767708299a408b4a234ee9ad4f45b0e6e0c21e6d

https://github.com/D-Programming-Language/dmd/commit/13195c39ae3e3788c559d8e88d3203371e43f029

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