Bug 720 – bug in array literal parsing with append

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-12-22T13:51:00Z
Last change time
2014-02-15T13:21:52Z
Keywords
ice-on-valid-code
Assigned to
bugzilla
Creator
kevinbealer

Comments

Comment #0 by kevinbealer — 2006-12-22T13:51:51Z
The following code causes an assert in dmd -- it seems to have to do with deducing the type of an array literal. If I assign the array literal to a variable, then append that to the array, it works. The error: dmd -ofmini mini.d Internal error: ../ztc/cod1.c 2526 The code: ----- void foo() { int[2][] pos; pos ~= [1, 2]; } int main(char[][] a) { foo(); return 0; } ----- Kevin
Comment #1 by thomas-dloop — 2006-12-26T08:31:19Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] schrieb am 2006-12-22: > http://d.puremagic.com/issues/show_bug.cgi?id=720 > The following code causes an assert in dmd -- it seems to have to do with > deducing the type of an array literal. If I assign the array literal to > a variable, then append that to the array, it works. > > The error: > > dmd -ofmini mini.d > Internal error: ../ztc/cod1.c 2526 > > The code: > > ----- > void foo() > { > int[2][] pos; > pos ~= [1, 2]; > } > > int main(char[][] a) > { > foo(); > return 0; > } > ----- Added to DStress as http://dstress.kuehne.cn/run/o/opCatAssign_20_A.d http://dstress.kuehne.cn/run/o/opCatAssign_20_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFkRKJLK5blCcjpWoRAuHpAJsGPV16dUaya0KR8bOFGSlmAzU2CACgmvpx kKxDyMCl6dr6DyXguyCb7fg= =wdM5 -----END PGP SIGNATURE-----
Comment #2 by thomas-dloop — 2007-04-27T12:32:47Z
Fixed since DMD-1.00