<div class="gmail_quote">On Fri, Jul 13, 2012 at 11:30 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="HOEnZb"><div class="h5">On 7/13/12 3:18 PM, Christophe Travert 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>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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>
</blockquote>
<br>
That would mean AppleSeed has two outer fields: a Fruit and an Apple.<br>
</blockquote>
<br>
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.<u></u>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>
</blockquote>
<br></div></div>
Makes sense, thanks.<span class="HOEnZb"><font color="#888888"><br>
<br>
Andrei<br>
<br>
</font></span></blockquote></div><br>The initial question was: why does DMD 2.059 reject this if this makes sense? <div>It's not even a new feature. It's a (possibly) new (and apparently sensible) use case of an existing feature.</div>
<div><br></div><div>I came up with this when I was trying to work around the limitation of not having multiple inheritance.<br clear="all"><div><br></div>-- <br>Bye,<br>Gor Gyolchanyan.<br>
</div>