www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 467] New: double inheritance from the same interface

reply d-bugmail puremagic.com writes:
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.


-- 
Oct 28 2006
next sibling parent d-bugmail puremagic.com writes:
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();
}


-- 
Oct 28 2006
prev sibling next sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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 -----BEGIN PGP SIGNATURE----- iD8DBQFFUfR+LK5blCcjpWoRAgonAKCqVqjjuGAdYZqskW2lQZuMoUcfYwCcDun7 6DLERJqb/WPjfO3/OjNbINc= =PEln -----END PGP SIGNATURE-----
Nov 08 2006
prev sibling next sibling parent d-bugmail puremagic.com writes:
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.)


-- 
Nov 18 2006
prev sibling parent d-bugmail puremagic.com writes:
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


-- 
Nov 25 2006