blob: 714e988809e37ecfa0e187c719d161dbc819a6d1 [file] [log] [blame]
// TARGET_BACKEND: JVM
// WITH_STDLIB
fun foo() {}
fun box(): String {
try {
foo() as Int?
}
catch (e: ClassCastException) {
return "OK"
}
catch (e: Throwable) {
return "Fail: ClassCastException should have been thrown, but was instead ${e.javaClass.getName()}: ${e.message}"
}
return "Fail: no exception was thrown"
}