This code is incorrect but it shouldn't cause an internal compiler error.
void main()
{
int[2][] a;
a ~= [1,2];
// should be a ~= [[1,2]];
}
I get: Internal error: ..\ztc\cod1.c 2526
Comment #1 by wbaxter — 2006-12-26T11:53:56Z
On second thought, maybe that should compile. Generally speaking this works:
T[] a;
T b;
a ~= b
For instance it's no problem if T is int,float, or any struct, etc. In this case T happens to be int[2], and it crashes the compiler.
Anyway, this (concatenating single elements with arrays) is one point on which the spec is notably silent. If the above is not supposed to work, then it is an error for it to work in the case of int, float et al. If it is supposed to work, then it is an error for it not to work for int[2].
Either way the spec should probably be explicit about whether the above is legal.