Files
kotlin-fork/compiler/testData/codegen/box/smartCasts/nullSmartCast.kt
T
2021-10-02 06:14:35 +00:00

11 lines
195 B
Kotlin
Vendored

// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: NULL_REF_CAST
fun String?.foo() = this ?: "OK"
fun foo(i: Int?): String {
if (i == null) return i.foo()
return "$i"
}
fun box() = foo(null)