Files
kotlin-fork/compiler/testData/ir/irText/expressions/kt47082.kt.txt
T
2021-06-03 12:37:17 +03:00

31 lines
563 B
Plaintext
Vendored

fun <E : Any?> produce(@BuilderInference block: @ExtensionFunctionType Function1<Derived<E>, Unit>): E {
return null as E
}
interface Derived<in E : Any?> : Base<E> {
}
interface Base<in E : Any?> {
}
interface Receiver<out E : Any?> {
}
fun <E : Any?, C : Base<E>> Receiver<E>.toChannel(destination: C): C {
return null as C
}
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 box(): String {
return "OK"
}