[NI] Postpone calls with not enough information in builder inference

This commit is contained in:
Dmitriy Novozhilov
2020-01-13 15:47:25 +03:00
parent f4b3e9b4b2
commit 3428a17759
16 changed files with 206 additions and 35 deletions
+26
View File
@@ -0,0 +1,26 @@
// !LANGUAGE: +NewInference
// !USE_EXPERIMENTAL: kotlin.Experimental
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
// ISSUE: KT-35684
import kotlin.experimental.ExperimentalTypeInference
fun test() {
sequence {
yield(materialize())
yield(materialize<Int>())
}
}
@UseExperimental(ExperimentalTypeInference::class)
fun <U> sequence(@BuilderInference block: suspend Inv<U>.() -> Unit) {}
interface Inv<T> {
fun yield(element: T)
}
fun <K> materialize(): Inv<K> = TODO()
fun box(): String = "OK"