www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 502] New: reimplementing methods for interface

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=502

           Summary: reimplementing methods for interface
           Product: D
           Version: 0.173
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: benoit tionex.de


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.


-- 
Nov 13 2006
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=502


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID




------- Comment #1 from bugzilla digitalmars.com  2006-11-26 02:33 -------
This is as designed:

"A reimplemented interface must implement all the interface functions, it does
not inherit them from a super class:"


-- 
Nov 26 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=502





------- Comment #2 from smjg iname.com  2006-11-26 03:08 -------
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?


-- 
Nov 26 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=502


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         OS/Version|Linux                       |All
         Resolution|INVALID                     |




------- Comment #3 from smjg iname.com  2007-11-08 08:10 -------
Reopening per lack of response to my last comment, and considering that it's
been brought up again.


-- 
Nov 08 2007
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=502


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |davidl 126.com




------- Comment #4 from smjg iname.com  2007-11-08 08:11 -------
*** Bug 1584 has been marked as a duplicate of this bug. ***


-- 
Nov 08 2007