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

19 lines
347 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
interface A<T, U> {
fun foo(t: T, u: U) = "A"
}
class Z<T> : A<T, Int> {
override fun foo(t: T, u: Int) = "Z"
}
fun box(): String {
val z = Z<Int>()
val a: A<Int, Int> = z
return when {
z.foo(0, 0) != "Z" -> "Fail #1"
a.foo(0, 0) != "Z" -> "Fail #2"
else -> "OK"
}
}