Files
kotlin-fork/compiler/testData/codegen/box/bridges/substitutionInSuperClass/upperBound.kt
T
Alexander Udalov 04c237cc22 Generate bridges for fake overrides when needed
#KT-3985 Fixed
 #KT-4145 Fixed
2014-04-11 21:57:44 +04:00

21 lines
366 B
Kotlin

open class A<T : Number> {
open fun foo(t: T) = "A"
}
open class B : A<Int>()
class Z : B() {
override fun foo(t: Int) = "Z"
}
fun box(): String {
val z = Z()
return when {
z.foo(0) != "Z" -> "Fail #1"
(z : B).foo(0) != "Z" -> "Fail #2"
(z : A<Int>).foo(0) != "Z" -> "Fail #3"
else -> "OK"
}
}