Files
kotlin-fork/compiler/testData/ir/irText/expressions/elvis.kt
T
Sergej Jaskiewicz 02180e8685 Factor out duplicated mangling logic for functions into the base class
^KT-57777 Fixed
^KT-57818 Fixed
2023-05-26 10:55:24 +00:00

18 lines
304 B
Kotlin
Vendored

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