Files
kotlin-fork/compiler/testData/ir/irText/expressions/ifElseIf.fir.kt.txt
T
Mikhail Glukhikh ae4b8be16b FIR2IR: never generate empty when #KT-55459 Fixed
In details, this commit changes the following:
- it converts FIR when without branches to empty IR block without when
- it doesn't drop empty else branches in when anymore
2023-01-25 12:31:34 +00:00

40 lines
579 B
Plaintext
Vendored

fun test(i: Int): Int {
return when {
greater(arg0 = i, arg1 = 0) -> 1
less(arg0 = i, arg1 = 0) -> -1
else -> 0
}
}
fun testEmptyBranches1(flag: Boolean) {
when {
flag -> { // BLOCK
}
else -> true
} /*~> Unit */
when {
flag -> true /*~> Unit */
}
}
fun testEmptyBranches2(flag: Boolean) {
when {
flag -> { // BLOCK
}
else -> true
} /*~> Unit */
when {
flag -> true
else -> { // BLOCK
}
}
}
fun testEmptyBranches3(flag: Boolean) {
when {
flag -> { // BLOCK
}
else -> true
} /*~> Unit */
}