interfaces :-(

Walter Bright newshound at digitalmars.com
Thu Mar 9 14:27:39 PST 2006


"John Demme" <me at teqdruid.com> wrote in message 
news:dqae9p$2bhh$1 at digitaldaemon.com...
> I'm not sure that I fully understand covariance either, but that's the 
> word
> that Walter used to say why the following doesn't work.
>
> interface I
> {
>        I clone();
> }
>
> class A: I
> {
>        A clone();
> }

It'll work if you rewrite it as:

 interface I
{
       Object clone();
}

class A: I
{
       A clone();
}





More information about the Digitalmars-d-dtl mailing list