<div class="gmail_quote">On Fri, Jul 13, 2012 at 11:10 PM, Andrei Alexandrescu <span dir="ltr"><<a href="mailto:SeeWebsiteForEmail@erdani.org" target="_blank">SeeWebsiteForEmail@erdani.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 7/13/12 3:07 PM, Gor Gyolchanyan wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On Fri, Jul 13, 2012 at 11:03 PM, Andrei Alexandrescu<br></div>
<<a href="mailto:SeeWebsiteForEmail@erdani.org" target="_blank">SeeWebsiteForEmail@erdani.org</a> <mailto:<a href="mailto:SeeWebsiteForEmail@erdani.org" target="_blank">SeeWebsiteForEmail@<u></u>erdani.org</a>>><div>
<div class="h5"><br>
wrote:<br>
<br>
    On 7/13/12 2:30 PM, Gor Gyolchanyan wrote:<br>
<br>
        The whole point is to have it not static. I need it to be properly<br>
        nested with the this.outer.<br>
<br>
<br>
    What would be the type of this.outer?<br>
<br>
    Andrei<br>
<br>
<br></div></div><div class="im">
For Fruit.Seed it's Fruit, for AppleSeed it's Apple. This makes sense<br>
because the Apple, which AppleSeed sees is the same object, which<br>
Fruit.Seed sees as it's base type Fruit.<br>
</div></blockquote>
<br>
That would mean AppleSeed has two outer fields: a Fruit and an Apple.<span class="HOEnZb"><font color="#888888"><br>
<br>
Andrei<br>
<br>
</font></span></blockquote></div><br>Why? The this.outer would be the same object from both perspectives. The difference is, that the Fruit.Seed would see it as Fruit and the AppleSeed would see it as Apple. And If someone derived from Apple and AppleSeed (say RedAple and RedAppleSeed), the RedAppleSeed would see the exact same object, except typed as RedApple.<div>
<br></div><div>When you create a new AppleSeed, you need to create it from an Apple or something derived from an Apple. This ensures, that every seed sees the correct fruit as the correct type.<br clear="all"><div><br></div>
-- <br>Bye,<br>Gor Gyolchanyan.<br>
</div>