[Issue 734] New: Multidimensional arrays use incorrect initializer
Thomas Kuehne
thomas-dloop at kuehne.cn
Tue Dec 26 06:30:11 PST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
d-bugmail at puremagic.com schrieb am 2006-12-23:
> http://d.puremagic.com/issues/show_bug.cgi?id=734
> ------------------
> typedef int Xint = 42;
> void test1()
> {
> Xint[3][] x = new Xint[3][4];
> foreach(Xint[3] i; x) {
> foreach (Xint j; i)
> assert(j == 42);
> }
> }
> void test2()
> {
> Xint[3][] x = new Xint[3][4];
> x.length = 200;
> assert(x.length == 200);
> foreach(Xint[3] i; x) {
> foreach (Xint j; i)
> assert(j == 42);
> }
> }
> void main()
> {
> test1();
> test2();
> }
> -----------------
Added to DStress as
http://dstress.kuehne.cn/run/a/array_initialization_30_A.d
http://dstress.kuehne.cn/run/a/array_initialization_30_B.d
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFFkP+cLK5blCcjpWoRAsYwAKCGJPvWAO4U0WG+PLNpUkhRP3Z8VQCfaH3k
bPUunaB4/pmvllZcXnFv42g=
=bpRX
-----END PGP SIGNATURE-----
More information about the Digitalmars-d-bugs
mailing list