interface not able to use functions from base classes??
Maxim Fomin
maxim at maxim-fomin.ru
Wed Dec 25 00:48:31 PST 2013
On Wednesday, 25 December 2013 at 07:40:03 UTC, Øivind wrote:
> Why doesn't this work:
>
> ----
>
> class A {
> int f(int x) {
> return x;
> }
> }
>
> interface I {
> int f(int x);
> }
>
> class B : A, I {
>
> }
>
> void main() {}
>
> ----
>
> I get the following error with DMD 2.064.2:
>
> /d122/f338.d(11): Error: class f338.B interface function 'int
> f(int x)' is not implemented
http://dlang.org/interface.html
Strictly speaking B does not implement function and inhereting
function from base class is not the same as implementing the
function.
More information about the Digitalmars-d
mailing list