04c237cc22
#KT-3985 Fixed #KT-4145 Fixed
22 lines
329 B
Kotlin
22 lines
329 B
Kotlin
// KT-3985
|
|
|
|
trait 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"
|
|
}
|