Files
kotlin-fork/compiler/testData/ir/irText/declarations/kt47527.kt.txt
T
2024-02-16 10:19:38 +00:00

49 lines
1.0 KiB
Kotlin
Vendored

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