Files
kotlin/compiler/testData/codegen/box/bridges/methodFromTrait.kt
Alexander Udalov 41a416da60 Move blackBoxFile() testData to box/ directory
Delete all test methods (and empty test classes), since they'll be
auto-generated
2013-01-28 18:20:17 +04:00

17 lines
318 B
Kotlin

trait 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>()
return when {
z.foo(0, 0) != "Z" -> "Fail #1"
(z : A<Int, Int>).foo(0, 0) != "Z" -> "Fail #2"
else -> "OK"
}
}