[Issue 411] New: array alloc with size from another array

Thomas Kuehne thomas-dloop at kuehne.cn
Thu Oct 12 08:10:09 PDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail at puremagic.com schrieb am 2006-10-09:
> http://d.puremagic.com/issues/show_bug.cgi?id=411

> void main(){
>     int[]  ia;
>     ia ~= 3;
>     byte[] data = new byte[ia[0]]; // line 5
>     byte[] data2 = new byte[ cast(int)(ia[s])]; // this compiles
> }
>
> a.d(5): need size of rightmost array, not type ia[0]

Added to DStress as
http://dstress.kuehne.cn/run/a/array_initialization_28_A.d
http://dstress.kuehne.cn/run/a/array_initialization_28_B.d
http://dstress.kuehne.cn/run/a/array_initialization_28_C.d

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFFLlhBLK5blCcjpWoRAlQ5AJsEkjPUjsAlKXKtndnBpGIMXFA48gCghARl
lOPJDR/hCDGqqkfR9vHjpeI=
=9PWe
-----END PGP SIGNATURE-----



More information about the Digitalmars-d-bugs mailing list