compiler-design-eth/javali_tests/HW3_nop90/OperatorTests/ErrorEquals.javali

26 lines
307 B
Text
Raw Normal View History

2020-01-15 22:32:25 +01:00
// Test the equal/not equal operations
// this test should trigger an TYPE ERROR
class Main {
void main() {
C1 a;
C3 d;
D1 f;
boolean x,y,z;
a = new C1();
d = new C3();
f = new D1();
y = f == d;
x = a != f;
}
}
class C1 {}
class C2 extends C1{}
class C3 extends C2{}
class D1 {}