Bug 502 – reimplementing methods for interface

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
All
Creation time
2006-11-13T16:12:00Z
Last change time
2014-02-15T13:20:20Z
Keywords
rejects-valid, spec
Assigned to
bugzilla
Creator
benoit

Comments

Comment #0 by benoit — 2006-11-13T16:12:00Z
http://www.digitalmars.com/d/interface.html A reimplemented interface must implement all the interface functions, it does not inherit them from a super class: interface D{ int foo(); } class A : D{ int foo() { return 1; } } class B : A, D{ alias A.foo foo; // shouldn't this work for the reimplementation ??? } in DMD 0.173 it doesn't.
Comment #1 by bugzilla — 2006-11-26T02:33:36Z
This is as designed: "A reimplemented interface must implement all the interface functions, it does not inherit them from a super class:"
Comment #2 by smjg — 2006-11-26T03:08:00Z
The quotation says nothing about whether this is valid code. It merely states _that_ a class that reimplements an interface must implement the interface functions, not _how_ it may or may not go about doing so. Hence the comment, "shouldn't this work for the reimplementation ???" i.e. shouldn't this be one way to go about implementing the interface functions?
Comment #3 by smjg — 2007-11-08T08:10:04Z
Reopening per lack of response to my last comment, and considering that it's been brought up again.
Comment #4 by smjg — 2007-11-08T08:11:05Z
*** Bug 1584 has been marked as a duplicate of this bug. ***
Comment #5 by bugzilla — 2012-01-21T11:18:28Z
An alias is not an implementation.