Bug 734 – Multidimensional arrays use incorrect initializer

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2006-12-23T13:04:00Z
Last change time
2014-02-15T13:19:08Z
Keywords
wrong-code
Assigned to
bugzilla
Creator
dvdfrdmn

Comments

Comment #0 by dvdfrdmn — 2006-12-23T13:04:54Z
------------------ 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(); } -----------------
Comment #1 by thomas-dloop — 2006-12-26T08:35:48Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] 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-----
Comment #2 by bugzilla — 2007-01-03T22:08:10Z
Fixed DMD 1.00