Files
kotlin-fork/compiler/testData/codegen/box/elvis/genericElvisWithMoreSpecificLHS.kt
T
Mikhail Zarechenskiy ca8da22569 [NI] Improve CST algorithm to handle non-fixed variables
#KT-32456 Fixed
 #KT-32423 Fixed
 #KT-32818 Fixed
 #KT-33197 Fixed
2019-10-31 11:32:00 +03:00

18 lines
346 B
Kotlin
Vendored

// !LANGUAGE: +NewInference
// WITH_RUNTIME
// IGNORE_BACKEND: JS_IR
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"
}