Files
kotlin-fork/compiler/testData/codegen/box/inference/builderInference/callableReferenceAndCoercionToUnit.kt
T
Alexander Udalov 1071919706 Remove backend tests on old inference
Also remove any mentions of NewInference, and rename some tests.
2021-11-09 20:07:33 +01:00

18 lines
321 B
Kotlin
Vendored

// !DIAGNOSTICS: -OPT_IN_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"
}
}