[NI] Add regression tests for builder inference

Actual fix is c02dd720
^KT-33542 Fixed
^KT-33544 Fixed
^KT-36446 Fixed
This commit is contained in:
Pavel Kirpichenkov
2020-02-17 15:22:05 +03:00
parent 6ed1cc5cd8
commit a50911156d
8 changed files with 140 additions and 0 deletions
@@ -0,0 +1,39 @@
// Issues: KT-33542, KT-33544
// WITH_RUNTIME
// KJS_WITH_FULL_RUNTIME
// IGNORE_BACKEND_FIR: JVM_IR
// !LANGUAGE: +NewInference
import kotlin.experimental.ExperimentalTypeInference
interface In<in E> {
suspend fun send(element: E)
}
class InImpl<E>(val block: suspend In<E>.() -> Unit) : In<E> {
override suspend fun send(element: E) {}
}
@OptIn(ExperimentalTypeInference::class)
public fun <T> builder(@BuilderInference block: suspend In<T>.() -> Unit) {
InImpl(block)
}
fun test33542() {
builder {
send(run {
15
})
}
}
fun test33544(){
builder {
send(run {
let { 0 } ?: 1
0
})
}
}
fun box() = "OK"