On Fri, Jul 13, 2012 at 11:02 PM, Era Scarecrow <[email protected]> wrote:
> On Friday, 13 July 2012 at 18:55:28 UTC, > [email protected](Christophe Travert) wrote: > >> "Era Scarecrow" , dans le message (digitalmars.D:172272), a écrit : >> >>> Then perhaps have the inherited class within fruit? >>> >>> class Fruit { >>> class Seed {} >>> class Appleseed : Seed {} >>> } >>> >> >> But then AppleSeed doesn't know about Apple.... >> > > So I forgot the apple :P But then inner inheritance won't work. > > class Fruit { > class Seed {} > class Apple { > class Appleseed : Seed {} //same error as before > } > } > > If you make seed static, then Appleseed & apple will have access to Fruit > but seed (by itself) won't. Other combinations faile as far as I can tell. > How far you can take inner class inheritance I don't know, but it seems not > that many levels. > This all won't work, because having Fruit know about Apple defeats the whole purpose. -- Bye, Gor Gyolchanyan.
