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() { }
-----