In the docs it says twice inheriting from the same interface is not allowed.
But DMD accepts it and compiles it.
Comment #1 by roel.mathys — 2006-10-28T05:44:20Z
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();
}
Comment #2 by thomas-dloop — 2006-11-08T09:38:54Z
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[email protected] 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-----
Comment #3 by matti.niemenmaa+dbugzilla — 2006-11-18T10:36:07Z
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.)