https://issues.dlang.org/show_bug.cgi?id=16306
Issue ID: 16306
Summary: Interface extending another interface with same method
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
interface A
{
void foo();
}
interface B: A
{
void bar();
final void foo()
{
bar();
}
}
class C: B
{
void bar() {}
} // error: C does not implement A.foo
class D: B
{
void foo() {}
void bar() {}
} // error: cannot override final B.foo
So A.foo is still looked up to guarantee create the vtable, but there's no way
to provide it because B.foo is final. B.foo "hides" A.foo, without overriding
it. Why doesn't B.foo override A.foo?
This should either work as expected (B.foo overrides A.foo) or an error shall
be emitted at the definition of B.foo, because it "hides" A.foo.
See also: http://forum.dlang.org/thread/[email protected]
--