D casting broke?

ag0aep6g via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 19 13:21:35 PDT 2016


On 06/19/2016 09:59 PM, Joerg Joergonson wrote:
> This should be completely valid since B!T' obviously derives from A!T
> directly

ok

> and we see that T' derives from b which derives from a
> directly.

ok

> So B!b is an entirely derived from A!a

No. B!b is derived from A!b, not from A!a. `b` being derived from `a` 
does not make A!b derived from A!a.

Here is the full inheritance tree:

X
├─x
│ └─a
│   └─b
├─A!a
└─A!b
   └─B!b


More information about the Digitalmars-d-learn mailing list