grep

Dee Girl deegirl at noreply.com
Fri May 9 22:58:28 PDT 2008


janderson Wrote:

> //ie
> class A
> {
> 
> };
> 
> class B : A
> {
> 
> };
> 
> 	B[] b;
> 	b ~= new B;
> 	A[] a = b;
> 	a ~= new A;
> //b[1] Is not an A type (not a B type), but is essentially a reinterpret 
> A -> B.

Your example compiles but it was so good if it did not. Modifiable arrays should never be covariant! Why did D make the same mistake that Java and Eiffel did? Newer languages should learn from the mistakes of the old languages. This is more than a bit disappointing. Dee Girl



More information about the Digitalmars-d mailing list