[NI] Fix shouldRunCompletion for builder inference session

#KT-41308 Fixed
#KT-41363
This commit is contained in:
Dmitriy Novozhilov
2020-08-25 11:56:36 +03:00
parent e98cbf81cf
commit 9cde42e2bc
22 changed files with 162 additions and 5 deletions
@@ -0,0 +1,20 @@
// IGNORE_BACKEND: JS_IR
// IGNORE_BACKEND_FIR: JVM_IR
// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -EXPERIMENTAL_API_USAGE_ERROR -UNUSED_EXPRESSION
// WITH_RUNTIME
@OptIn(ExperimentalStdlibApi::class)
fun test(s: String?): Int {
val list = buildList {
s?.let(::add)
}
return list.size
}
fun box(): String {
return when (test("hello")) {
1 -> "OK"
else -> "Error"
}
}