[Issue 10744] New: Rejects valid interface inheritance + wrong error message

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 2 05:54:38 PDT 2013


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

           Summary: Rejects valid interface inheritance + wrong error
                    message
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: yazan.dabain at gmail.com


--- Comment #0 from yazan.dabain at gmail.com 2013-08-02 05:54:37 PDT ---
interface A {
  Foo foo();
  int x(); // must exist for the bug to appear
}

class B : A {
  override Bar foo() { // must return a child of the class returned by the
interface
    return new Bar();
  }
  override int x() { return 0; } // must exist
}

class Foo {
  void foo() {}
}

class Bar : Foo {
  override void foo() {}
}

void main() {}

On DMD GIT HEAD commit 73e375a, the compiler errors with the following message:
main.d(6): Error: class main.B interface function 'int x()' is not implemented

The example compiles successfully on DMD v2.063.2

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


More information about the Digitalmars-d-bugs mailing list