// !LANGUAGE: +UnrestrictedBuilderInference // WITH_STDLIB import kotlin.experimental.ExperimentalTypeInference @OptIn(ExperimentalTypeInference::class) fun flow(block: suspend FlowCollector.() -> Unit) = Flow() @OptIn(ExperimentalTypeInference::class) fun produce(block: suspend SendChannel.() -> Unit) {} interface SendChannel { val onSend: SelectClause2> } interface SelectClause2 class Flow interface FlowCollector interface SelectBuilder { operator fun SelectClause2.invoke(param: P, block: suspend (Q) -> R) } inline fun select(crossinline builder: SelectBuilder.() -> Unit) = Unit as R fun box(): String { val x: Flow = flow { produce { select { onSend("") { } } } } return "OK" }