What is the sub interface?
Haruki Shigemori
rayerd.wiz at gmail.com
Tue Mar 24 10:28:39 PDT 2009
(1)
interface A {void a();}
interface B : A {}
(2)
interface B {void a();}
If both interfaces of B are the *same* when paying attention to interface B,
I think that the next code is invalid-accept about class C2.
Because class C2 do not have a method "void a(){}".
http://www.digitalmars.com/d/2.0/interface.html
> A reimplemented interface must implement all the interface functions,
it does not inherit them from a super class
interface I1 {void a();}
interface I2 : I1 {}
class C1 : I2 {void a(){}}
class C2 : C1, I2 {} // invalid-accept? (dmd 2.026)
How do you think about?
More information about the Digitalmars-d
mailing list