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]
Comment #1 by simen.kjaras — 2020-02-28T12:19:24Z
*** Issue 13690 has been marked as a duplicate of this issue. ***
Comment #2 by robert.schadek — 2024-12-13T18:49:04Z