Bug 10744 – [regression git-head v2.064] Rejects valid interface inheritance + wrong error message

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-08-02T05:54:00Z
Last change time
2013-08-06T20:51:53Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
yazan.dabain

Comments

Comment #0 by yazan.dabain — 2013-08-02T05:54:37Z
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
Comment #1 by andrej.mitrovich — 2013-08-03T08:12:26Z
Reduced test-case: ----- interface A { Foo foo(); int x(); } class B : A { Bar foo() { return null; } int x() { return 0; } } class Foo { } class Bar : Foo { } void main() { } -----
Comment #2 by henning — 2013-08-06T07:33:56Z
Comment #3 by github-bugzilla — 2013-08-06T20:51:33Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a291385c024e4477dd0d3b5eccb430ef058bb8bc fix issue 10744 - Rejects valid interface inheritance + wrong error message https://github.com/D-Programming-Language/dmd/commit/0e2779a4cce616c3ede135fe8d4b06a7b91333f5 Merge pull request #2451 from hpohl/10744 [REG2.064a] fix issue 10744 - Rejects valid interface inheritance + wrong error message