On Fri, Jul 13, 2012 at 10:19 PM, Andrei Alexandrescu <SeeWebsiteForEmail@erdani.org> wrote:
On 7/13/12 1:59 PM, Gor Gyolchanyan wrote:
Doesn't this make sense?

class Fruit
{
     class Seed { }
}

class Apple: Fruit
{
      class AppleSeed: Fruit.Seed { }
}

This means, that as Fruit.Seed needs access to enclosing Fruit,
AppleSeed, being a Fruit.Seed will also have access to enclosing Fruit,
which is Apple.
DMD 0.259 has this to say:

Error: class main.Apple.AppleSeed is nested within Apple, but super
class Seed is nested within Fruit

Which doesn't make sense, IMO. What do you guys think about this? Who
makes more sense me or DMD 2.059?

Untested:

class Fruit
{
    static class Seed { }
}

class Apple: Fruit
{
     static class AppleSeed: Fruit.Seed { }
}


Andrei

The whole point is to have it not static. I need it to be properly nested with the this.outer.

--
Bye,
Gor Gyolchanyan.