16 lines
210 B
Text
16 lines
210 B
Text
|
/* Test illegal downcasts */
|
||
|
|
||
|
class A { }
|
||
|
class B extends A { }
|
||
|
|
||
|
class Main {
|
||
|
void main() {
|
||
|
A a;
|
||
|
B b;
|
||
|
a = new A();
|
||
|
b = (B) a; /* Should fail at runtime */
|
||
|
write(0);
|
||
|
writeln();
|
||
|
}
|
||
|
}
|