compiler-design-eth/javali_tests/HW3_nop90/FieldTests/ErrorAccessField.javali

22 lines
205 B
Text
Raw Normal View History

2020-01-15 22:32:25 +01:00
// Test 'NO SUCH FIELD'
class Main {
void main() {
C1 c1;
C2 c2;
c1 = new C1();
c2 = new C2();
c1.a = 5;
c2.b = 6;
}
}
class C1{
int a;
}
class C2 extends C1 {}
class C3 extends C2 {}