Files
kotlin-fork/compiler/testData/codegen/box/elvis/genericElvisWithNullLHS.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

23 lines
651 B
Kotlin
Vendored

// WITH_RUNTIME
// IGNORE_BACKEND: JS_IR
fun test() {
fun returnMutableList(): MutableList<Int>? = null
fun returnsList(): List<Int>? = null
var mutableList: MutableList<Int>? = null
var list: List<Int>? = null
mutableListOf<Int>().addAll(returnMutableList() ?: emptyList<Int>())
mutableListOf<Int>().addAll(returnsList() ?: emptyList())
mutableListOf<Int>().addAll(list ?: emptyList())
mutableListOf<Int>().addAll(returnMutableList() ?: emptyList())
mutableListOf<Int>().addAll(mutableList ?: emptyList())
mutableListOf<Int>().addAll(null ?: emptyList())
}
fun box(): String {
test()
return "OK"
}