Files
kotlin-fork/compiler/testData/codegen/box/inference/builderInference/kt49887.kt
T
2021-12-15 22:23:18 +03:00

13 lines
231 B
Kotlin
Vendored

// WITH_STDLIB
fun test(): Int = buildList {
add(1)
add(2)
val number = removeLastOrNull() ?: throw Exception()
}.singleOrNull() ?: throw Exception()
fun box(): String {
return if (test() == 1) "OK" else "NOK"
}