Files
kotlin-fork/compiler/testData/ir/irText/expressions/kt47082.kt.txt
T
2024-02-16 10:19:38 +00:00

29 lines
543 B
Kotlin
Vendored

interface Base<in E : Any?> {
}
interface Derived<in E : Any?> : Base<E> {
}
interface Receiver<out E : Any?> {
}
fun box(): String {
return "OK"
}
fun <R : Any?> foo(r: Receiver<R>): R {
return produce<R>(block = local fun Derived<R>.<anonymous>() {
r.toChannel<R, Derived<R>>(destination = $this$produce) /*~> Unit */
}
)
}
fun <E : Any?> produce(block: @ExtensionFunctionType Function1<Derived<E>, Unit>): E {
return null as E
}
fun <E : Any?, C : Base<E>> Receiver<E>.toChannel(destination: C): C {
return null as C
}