Files
kotlin-fork/compiler/testData/codegen/box/bridges/simple.kt
T
Dmitriy Novozhilov 6735cc8937 [FIR] Implement new bound smartcast algorithm
#KT-36055 Fixed
2020-02-12 10:17:45 +03:00

19 lines
300 B
Kotlin
Vendored

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