NI: do substitution type variables during updating trace for lambda (these type variables can appear after the builder inference)
^KT-42450 Fixed
This commit is contained in:
+25
@@ -0,0 +1,25 @@
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
|
||||
class Foo<A>
|
||||
|
||||
fun <K> bar(x: Foo<K>): Unit {}
|
||||
|
||||
fun <E> foo(block: (Foo<E>) -> Unit): E = null as E
|
||||
|
||||
interface FlowCollector<T> {
|
||||
fun emit(value: T)
|
||||
}
|
||||
|
||||
@Suppress("EXPERIMENTAL_API_USAGE_ERROR")
|
||||
fun <I> flow(@BuilderInference block: FlowCollector<I>.() -> Unit): I = null as I
|
||||
|
||||
fun adapt(): Unit = flow {
|
||||
emit(foo { coroutine -> bar(coroutine) })
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
adapt()
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user