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

48 lines
1.0 KiB
Kotlin
Vendored

fun test_1(value: Any?): String? {
return { // BLOCK
val tmp_0: Any? = value
when {
EQEQ(arg0 = tmp_0, arg1 = null) -> null
else -> tmp_0.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 tmp_1: Any? = value
when {
EQEQ(arg0 = tmp_1, arg1 = null) -> null
else -> tmp_1.let<Any, Nothing>(block = local fun <anonymous>(it: Any): Nothing {
return "K"
}
)
}
}
}
)
}
fun box(): String {
var result: String = ""
result = result.plus(other = { // BLOCK
val tmp_2: String? = test_1(value = 1)
when {
EQEQ(arg0 = tmp_2, arg1 = null) -> return "fail 1"
else -> tmp_2
}
})
result = result.plus(other = { // BLOCK
val tmp_3: String? = test_2(value = 1)
when {
EQEQ(arg0 = tmp_3, arg1 = null) -> return "fail 2"
else -> tmp_3
}
})
return result
}