NI: clean calls in coroutine inference before the second analysis of += only for right side
^KT-39660 Fixed
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
import kotlin.experimental.ExperimentalTypeInference
|
||||
|
||||
interface SendChannel<in T> {
|
||||
suspend fun send(value: T)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalTypeInference::class)
|
||||
public fun <T> flux(@BuilderInference block: suspend SendChannel<T>.() -> Unit) {}
|
||||
|
||||
suspend inline fun <T> T.collect(action: (T) -> Unit) { action(this) }
|
||||
|
||||
fun test() {
|
||||
flux {
|
||||
var result = ""
|
||||
"OK".collect { result += it }
|
||||
send(result)
|
||||
}
|
||||
}
|
||||
|
||||
fun box() = "OK"
|
||||
Reference in New Issue
Block a user