Files
kotlin-fork/compiler/testData/ir/irText/declarations/kt47527.fir.kt.txt
T
Dmitriy Novozhilov ae608ea67f [FE 1.0] Always create return value for CallInstruction
This fixes missing `USED_AS_EXPRESSION` recordings
^KT-47527 Fixed
2021-07-02 17:55:20 +03:00

48 lines
1.1 KiB
Plaintext
Vendored

fun test_1(value: Any?): String? {
return { // BLOCK
val tmp0_safe_receiver: Any? = value
when {
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
else -> tmp0_safe_receiver.let<Any, Nothing>(block = local fun <anonymous>(it: Any): Nothing {
return "O"
}
)
}
}
}
fun test_2(value: Any?): String? {
return run<Nothing?>(block = local fun <anonymous>(): Nothing? {
return { // BLOCK
val tmp1_safe_receiver: Any? = value
when {
EQEQ(arg0 = tmp1_safe_receiver, arg1 = null) -> null
else -> tmp1_safe_receiver.let<Any, Nothing>(block = local fun <anonymous>(it: Any): Nothing {
return "K"
}
)
}
}
}
)
}
fun box(): String {
var result: String = ""
result = result.plus(other = { // BLOCK
val <elvis>: String? = test_1(value = 1)
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> return "fail 1"
else -> <elvis>
}
})
result = result.plus(other = { // BLOCK
val <elvis>: String? = test_2(value = 1)
when {
EQEQ(arg0 = <elvis>, arg1 = null) -> return "fail 2"
else -> <elvis>
}
})
return result
}