Move tests for builder inference into the corresponding directory

This commit is contained in:
Victor Petukhov
2020-12-23 14:29:03 +03:00
parent 9b148325fe
commit 39e579db91
13 changed files with 43 additions and 0 deletions
@@ -0,0 +1,24 @@
// ISSUE: KT-41164
// WITH_RUNTIME
import kotlin.experimental.ExperimentalTypeInference
interface MyProducerScope<in E>
interface MyFlow<out T>
fun <K> select(x: K, y: K): K = x
@OptIn(ExperimentalTypeInference::class)
fun <T> myCallbackFlow(@BuilderInference block: MyProducerScope<T>.() -> Unit): MyFlow<T> = null!!
fun MyProducerScope<*>.myAwaitClose(block: () -> Unit = {}) {}
fun <E> myEmptyFlow(): MyFlow<E> = null!!
fun test(): MyFlow<Int> {
return select(
myCallbackFlow {
myAwaitClose {}
},
myEmptyFlow()
)
}
fun box(): String = "OK"