array cast should be supported corrected

maelp mael.primet at gmail.com
Thu Aug 7 02:23:08 PDT 2008


> interface I { }
> class A : I { }
> class B : I { }
> 
> A[] aarray;
> I[] iarray = aarray;
> iarray ~= new B();
> A a = aarray[0]; // you BROKE my TYPE SYSTEM -- this is an instance of B

I guess, for most of the D programming language design decisions, it would help if we had
a kind of wiki listing those counterexamples, because it helps a lot when trying to wrap one's
head on "why is this feature un/available". We should just collect those and possibly link them
from the D documentation



More information about the Digitalmars-d mailing list