Bug 16306 – Interface extending another interface with same method

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-07-21T12:24:59Z
Last change time
2024-12-13T18:49:04Z
Assigned to
No Owner
Creator
Lodovico Giaretta
Moved to GitHub: dmd#19161 →

Comments

Comment #0 by lodovico — 2016-07-21T12:24:59Z
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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19161 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB