blob: 8c7048ededd20aeb1929844cc6a396e4af9dcb0e [file]
// ISSUE: KT-77008
// IGNORE_KLIB_RUNTIME_ERRORS_WITH_CUSTOM_FIRST_STAGE: 2.0.0 2.1.0 2.2.0
// IGNORE_KLIB_RUNTIME_ERRORS_WITH_CUSTOM_SECOND_STAGE: Native:2.2
// ^^^ KT-77008 is fixed in 2.3.0-Beta2
interface I
interface I2 : I {
fun func(): String
}
class A : I2 {
override fun func(): String = "OK"
}
class B : I2 {
override fun func(): String ="Fail B"
}
fun <T : I2> materialize(): T {
return A() as T
}
class MyThrowable : Throwable("")
fun box(): String {
val i: I
i = try {
materialize()
} catch(e: MyThrowable) {
B()
}
return i.func()
}