Incrementing/decrementing array length is applied twice when used in assignment
This fails currently:
void main () {
int[] i = {1, 2};
int j = --i.length;
assert (j == 1);
}
Internally, the assignment is transformed to int j = i.length = i.length-1;
and in the resulting C code we get:
i_length1 = i_length1 - 1;
j = i_length1 - 1;
_vala_assert (j == 1, "j == 1");