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.

Reply via email to