Files
kotlin-fork/compiler/testData/ir/irText/declarations/kt47527.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

49 lines
1.2 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 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 "K"
}
)
}
}
}
)
}
fun box(): String {
var result: String = ""
result = result.plus(other = { // BLOCK
val tmp0_elvis_lhs: String? = test_1(value = 1)
when {
EQEQ(arg0 = tmp0_elvis_lhs, arg1 = null) -> return "fail 1"
else -> tmp0_elvis_lhs
}
})
result = result.plus(other = { // BLOCK
val tmp1_elvis_lhs: String? = test_2(value = 1)
when {
EQEQ(arg0 = tmp1_elvis_lhs, arg1 = null) -> return "fail 2"
else -> tmp1_elvis_lhs
}
})
return result
}