Bug 10699 – override inconsistently allowed for abstract functions

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-22T18:33:00Z
Last change time
2014-07-18T11:51:11Z
Assigned to
nobody
Creator
andrej.mitrovich
See also
http://d.puremagic.com/issues/show_bug.cgi?id=9978

Comments

Comment #0 by andrej.mitrovich — 2013-07-22T18:33:22Z
----- interface IC { abstract void foo(); abstract void bar(); } class AC : IC { override void foo() { } } class CC : AC { override void bar() { } } ----- $ Error: function test.CC.bar does not override any function, did you mean to override 'test.IC.bar'? If we're allowed to use 'override' for implementing abstract methods in AC, why is it not allowed in CC? Also related: http://d.puremagic.com/issues/show_bug.cgi?id=9978
Comment #1 by andrej.mitrovich — 2013-07-22T18:35:10Z
I want these to work because it makes it clearer from reading the class that these methods can be called with a reference to a base class (and in fact the base class can call such a method itself). Disallowing 'override' in this case makes the code less clear.
Comment #2 by verylonglogin.reg — 2014-07-18T11:51:11Z
There is no `abstract` interface functions, see Issue 13156. *** This issue has been marked as a duplicate of issue 2525 ***