22 lines
333 B
Kotlin
Vendored
22 lines
333 B
Kotlin
Vendored
// KT-3985
|
|
|
|
interface Trait<T> {
|
|
fun f(): T
|
|
}
|
|
|
|
open class Class {
|
|
fun f(): String = throw UnsupportedOperationException()
|
|
}
|
|
|
|
class Foo: Class(), Trait<String> {
|
|
}
|
|
|
|
fun box(): String {
|
|
try {
|
|
(Foo() : Trait<String>).f()
|
|
} catch (e: UnsupportedOperationException) {
|
|
return "OK"
|
|
}
|
|
return "Fail"
|
|
}
|