17 lines
321 B
Kotlin
Vendored
17 lines
321 B
Kotlin
Vendored
// !LANGUAGE: +NewInference
|
|
// WITH_RUNTIME
|
|
|
|
fun test(foo: MutableList<String>?): List<String> {
|
|
val bar = foo ?: listOf()
|
|
return bar
|
|
}
|
|
|
|
fun box(): String {
|
|
val a = test(null)
|
|
if (a.isNotEmpty()) return "Fail 1"
|
|
|
|
val b = test(mutableListOf("a"))
|
|
if (b.size != 1) return "Fail 2"
|
|
|
|
return "OK"
|
|
} |