Array length should be preserved when casting to lower dimensions
Simple demonstration:
void main () {
var array_2d = new int[4,8];
unowned var array_1d = (int[]) array_2d;
print("%i\n", array_1d.length); // prints 4, should print 32
}
I'm less sure about the following cases:
- Cast to lower- but still multi-dimensional arrays, e.g. 3D array to 2D array - which length component should be multiplied by removed ones? I'd say the last one.
- Cast to higher-dimensional arrays (which currently fails with
internal: invalid array_length for given dimension
) - I guess length of newly added dimensions should be set to1
? Again, on which side?