Bug 18041 – Inconsistent behavior overriding functions from abstract classes that implement interfaces.

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-12-07T07:16:34Z
Last change time
2024-12-13T18:55:16Z
Assigned to
No Owner
Creator
IM
Moved to GitHub: dmd#19340 →

Comments

Comment #0 by 3d.immortal — 2017-12-07T07:16:34Z
This issue was discussed here in the forum: https://forum.dlang.org/thread/[email protected] I will repeat my description from there: Assume the following: interface IFace { void foo(); void bar(); } abstract class A : IFace { override void foo() {} } class B : A { override void bar() {} } This fails to compile with the following message: --->>> function bar does not override any function, did you mean to override 'IFace.bar()'? <<<--- So `override` works for A::foo(), but doesn't work for B::bar(). This is inconsistent and confusing. I would expect that `override` works for both cases. Please fix. Thank you.
Comment #1 by robert.schadek — 2024-12-13T18:55:16Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19340 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB