compiler-design-eth/javali_tests/HW3_nop90/Assignments/Errors/AssignToThis.javali

15 lines
269 B
Text
Raw Normal View History

2020-01-15 22:32:25 +01:00
// The left-hand side of an assignment cannot be a reference to this
// Valid options are variable accesses, fields or an indexed array
class Main {
void main () {
int b;
int[] c;
c = new int[5];
this.a = 10;
b = 10;
c[4] = 10;
this = null;
}
int a;
}