[Issue 12329] New: override for implementing interfaces is not allowed in a subclass
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Mar 9 06:59:18 PDT 2014
https://d.puremagic.com/issues/show_bug.cgi?id=12329
Summary: override for implementing interfaces is not allowed in
a subclass
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: andrej.mitrovich at gmail.com
--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2014-03-09 06:59:15 PDT ---
This is likely a dupe report but I can't find the report.
-----
module test;
interface I { void foo(); }
class C : I { override void foo() { } } // ok to use override here
class D : C { override void foo() { } }
class C2 : I { }
class D2 : C2 { override void foo() { } } // error
void main() { }
-----
The compiler should be consistent, either disallow override in both cases for C
and D2, or allow them both. But remember this is about *implementing* the
interface function, not overriding it.
Note that the diagnostic is also terrible:
Error: function test.D2.foo does not override any function, did you mean to
override 'test.I.foo'?
But I'm sure I saw this filed somewhere too.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list