Thread overview
[Issue 467] New: double inheritance from the same interface
Oct 28, 2006
d-bugmail
Oct 28, 2006
d-bugmail
Nov 08, 2006
Thomas Kuehne
Nov 18, 2006
d-bugmail
Nov 25, 2006
d-bugmail
October 28, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=467

           Summary: double inheritance from the same interface
           Product: D
           Version: 0.172
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: roel.mathys@gmail.com


In the docs it says twice inheriting from the same interface is not allowed. But DMD accepts it and compiles it.


-- 

October 28, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=467





------- Comment #1 from roel.mathys@gmail.com  2006-10-28 05:44 -------
Example code:

import std.stdio;

interface C
{
        void f();
}

class CC : C,C
{
        void f() { writefln("hello"); }
}

void main()
{
        CC cc = new CC();
        cc.f();
}


-- 

November 08, 2006
d-bugmail@puremagic.com schrieb am 2006-10-28:
> http://d.puremagic.com/issues/show_bug.cgi?id=467

> In the docs it says twice inheriting from the same interface is not allowed. But DMD accepts it and compiles it.

Added to DStress as http://dstress.kuehne.cn/nocompile/i/interface_26_A.d

Thomas


November 18, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=467


deewiant@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |deewiant@gmail.com
OtherBugsDependingO|                            |511
              nThis|                            |
                URL|                            |http://www.digitalmars.com/d
                   |                            |/interface.html
           Keywords|                            |spec




------- Comment #3 from deewiant@gmail.com  2006-11-18 10:36 -------
There's even a direct example of this in the spec, which DMD allows:

interface D
{
    void foo();
}

class A : D, D  // error, duplicate interface
{
}

(Of course, this doesn't compile also since foo() isn't defined in A.)


-- 

November 25, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=467


bugzilla@digitalmars.com changed:

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




------- Comment #4 from bugzilla@digitalmars.com  2006-11-25 03:55 -------
Fixed DMD 0.175


--