Files
kotlin-fork/compiler/testData/codegen/box/inference/builderInference/kt41164.kt
T
Denis.Zharkov d0a0739d10 FIR: Mute builder-inference related tests
They started failing once we began reporting diagnostics from completion

^KT-46421 Relates
2021-05-20 17:24:16 +03:00

26 lines
622 B
Kotlin
Vendored

// ISSUE: KT-41164
// WITH_RUNTIME
// IGNORE_BACKEND_FIR: JVM_IR
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"