Multiple Inheritance of Classes
Christopher Wright
dhasenan at gmail.com
Wed Aug 13 04:42:31 PDT 2008
Chris R. Miller wrote:
> Yeah, it's trivial to work around it (I did come from Java!) but some
> bits and pieces seem like it would be better if they could inherit
> behavior and data, not just a contract. It could be done through a
> mixin, but that defeats the polymorphism I want present in the design.
> And a Mixin and an interface just seems clunky. What if I do the mixin
> but forget the interface, or vice-versa? Yuk! Though it would give me
> the option of re-implementing it differently if necessary... a curious
> silver lining.
If you forget the mixin, you'll get a compile error about unimplemented
methods.
If you forget the interface, you'll get a compile error about illegal
implicit casts.
More information about the Digitalmars-d
mailing list