Does the expression [ 0, 1, 2 ] form an immutable array? If so, is the assignment to a[0] undefined below? Is it trying to modify an immutable element?
int[] a = [ 0, 1, 2 ];
a[0] = 42;
The reason for my thinking that [ 0, 1, 2] is an array is because it has the .dup property and this works too:
int[] a = [ 0, 1, 2 ].dup;
Thank you,
Ali