www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - Array initialization - compiler error

reply genie <sgenie maxnet.co.nz> writes:
I just found out that the (incorrect) initialization of an array:

int[] a={1,2,3};

causes the compiler (DMD, latest build) to assert:

Assertion failure: '0' on line 219 in file 'init.c'
abnormal program termination

rather than report an error.

surely, changing the line to:
int[] a=[1,2,3];

fixed it.
Nov 23 2006
parent Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
genie wrote:
 I just found out that the (incorrect) initialization of an array:
 
 int[] a={1,2,3};
 
 causes the compiler (DMD, latest build) to assert:
 
 Assertion failure: '0' on line 219 in file 'init.c'
 abnormal program termination
 
 rather than report an error.
 
 surely, changing the line to:
 int[] a=[1,2,3];
 
 fixed it.

Already reported: http://d.puremagic.com/issues/show_bug.cgi?id=587
Nov 23 2006