Files
kotlin-fork/compiler/testData/codegen/box/inference/unsafeVarianceCodegen.kt
T
Mikhail Zarechenskiy 4ffcbc0c2f [NI] Properly support UnsafeVariance annotation
#KT-38134 Fixed
 #KT-34433 Fixed
 #KT-31823 Fixed
2020-04-16 13:55:47 +03:00

11 lines
173 B
Kotlin
Vendored

class A<out K> {
fun foo(x: @UnsafeVariance K): K = x
}
fun test(a: A<*>): Any? {
return a.foo("OK")
}
fun box(): String {
return test(A<String>()) as String
}