<div class="gmail_quote">On Fri, Jul 13, 2012 at 11:18 PM, Christophe Travert <span dir="ltr"><<a href="mailto:travert@phare.normalesup.org" target="_blank">travert@phare.normalesup.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Andrei Alexandrescu , dans le message (digitalmars.D:172280), a écrit :<br>
<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>
><br>
> That would mean AppleSeed has two outer fields: a Fruit and an Apple.<br>
<br>
</div>Only one. Apple. And when AppleSeed.super seed this Apple, it sees a<br>
fruit.<br>
<br>
AppleSeed a;<br>
assert(is(typeof(a.outer) == Apple));<br>
assert(is(typeof(a.super) == Seed));<br>
assert(is(typeof(a.super.outer) == Fruit));<br>
//but:<br>
assert(a.outer is a.super.outer);<br>
<br>
If you can't figure out how can a.outer and a.super.outer have two<br>
different types, but be the same, think about covariant return.<br>
<br>
<br>
</blockquote></div><br>Exactly!<br clear="all"><div><br></div>-- <br>Bye,<br>Gor Gyolchanyan.<br>