Files
kotlin-fork/compiler/testData/codegen/box/elvis/genericElvisWithNullLHS.kt
T
2019-11-19 11:00:09 +03:00

24 lines
681 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// 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"
}