Files
kotlin-fork/compiler/testData/codegen/box/bridges/fakeGenericCovariantOverride.kt
T
2019-11-19 11:00:09 +03:00

24 lines
374 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// KT-3985
interface Trait<T> {
fun f(): T
}
open class Class {
fun f(): String = throw UnsupportedOperationException()
}
class Foo: Class(), Trait<String> {
}
fun box(): String {
val t: Trait<String> = Foo()
try {
t.f()
} catch (e: UnsupportedOperationException) {
return "OK"
}
return "Fail"
}