ceylon
ceylon copied to clipboard
Implement or disallow ++ on indexed expressions
trafficstars
The typechecker allows a[i]++, but this fails on the backends:
- Java: error: compiler bug: compiler bug: IndexExpression is not supported yet at unknown
- JS: silent failure
Note that the typechecker does not allow a[i] += 1.
Full example:
shared void run() {
value a = Array { 0, 0, 0 };
variable Integer i = 0;
a[i++]++;
print(a); // should be { 1, 0, 0 }
print(i); // should be 1
}
I would vote to implement both.