[NI] Don't always complete builder inference lambda in FULL mode

#KT-41164 Fixed
This commit is contained in:
Dmitriy Novozhilov
2020-08-20 15:04:52 +03:00
parent 6a15e0410f
commit e98cbf81cf
21 changed files with 181 additions and 10 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"