mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-18 08:31:38 +00:00
11 lines
173 B
Kotlin
Vendored
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
|
|
} |