Files
kotlin-fork/compiler/testData/codegen/box/builderInference/callableReferenceAndCoercionToUnit.kt
T
Svyatoslav Kuzmich f9503efb74 [JS IR] Make WITH_RUNTIME imply KJS_WITH_FULL_RUNTIME
There is a lot of intersection between these
2020-11-25 21:22:39 +03:00

21 lines
434 B
Kotlin
Vendored

// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: STDLIB_COLLECTIONS
// !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"
}
}