[Issue 13985] New: Wrong code when using "super" to call final interface method

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jan 15 05:10:13 PST 2015


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

          Issue ID: 13985
           Summary: Wrong code when using "super" to call final interface
                    method
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: wrong-code
          Severity: critical
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: thecybershadow at gmail.com

/////// test.d ///////
interface I
{
    void m1();
    void m2();
    void m3();

    final void mf()
    {
        m3();
    }
}

class C1 : I
{
    void m1() {}
    void m2() {}
    void m3() {}
}

class C2 : C1
{
    void ml()
    {
        super.mf();
    }
}

void main()
{
    auto l = new C2();
    l.ml();
}
//////////////////////

This program throws the exception:

object.Exception at src\object_.d(100): need opCmp for class test.C2

--


More information about the Digitalmars-d-bugs mailing list