Files
kotlin-fork/compiler/testData/ir/irText/expressions/elvis.kt
T
Vladimir Sukharev bae8b283c7 [IR] Normalize temp var names in Kotlin-like dump
^KT-61983 Fixed
2023-10-11 07:49:35 +00:00

19 lines
321 B
Kotlin
Vendored

// FIR_IDENTICAL
val p: Any? = null
fun foo(): Any? = null
fun test1(a: Any?, b: Any) = a ?: b
fun test2(a: String?, b: Any) = a ?: b
fun test3(a: Any?, b: Any?): String {
if (b !is String) return ""
if (a !is String?) return ""
return a ?: b
}
fun test4(x: Any) = p ?: x
fun test5(x: Any) = foo() ?: x