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

16 lines
194 B
Text
Raw Normal View History

2020-01-15 22:32:25 +01:00
// Test that arrays are not covariant
class Main {
void main() {
boolean y;
A[] Array1;
B[] Array2;
Array2 = new B[10];
Array1 = Array2;
}
}
class B extends A {}
class A {}