Assignment operators (+=, -=, etc) don't work for nullable simple type arrays
The following vala code will generate invalid C code and cause cc errors, since valac
doesn't convert the assignment operators to binary expressions.
void main () {
int?[] arr = {1, 2, 3};
arr[0] += 1;
arr[1] *= 3;
arr[2] -= 2;
}
The cc errors:
nullable-array-assign.vala.c:68:9: error: invalid operands to binary + (have ‘gint *’ {aka ‘int *’} and ‘gint *’ {aka ‘int *’})
68 | arr[0] += _tmp8_;
| ^~
nullable-array-assign.vala.c:72:9: error: invalid operands to binary * (have ‘gint *’ {aka ‘int *’} and ‘gint *’ {aka ‘int *’})
72 | arr[1] *= _tmp10_;
| ^~
nullable-array-assign.vala.c:76:9: warning: assignment to ‘gint *’ {aka ‘int *’} from ‘long int’ makes pointer from integer without a cast [-Wint-conversion]
76 | arr[2] -= _tmp12_;
| ^~