Array initialisation vs assignment

bearophile bearophileHUGS at lycos.com
Fri Mar 14 16:10:56 PDT 2014


ed:

> void main()
> {
>     int[] a = [1,2,3,4];
>     int[2][2] b = a; // fine, does an array copy
> }

> Is it a bug or by design?

That looks like a compiler bug. You are supposed to use a cast to 
do an assignment like that.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list