Files
Ivan Kylchik 86e6912447 [FIR2IR] Don't generate excess IR block from FirSingleExpressionBlock
This is needed to unify K1 and K2 behavior.

#KT-65064
#KT-63781 Fixed
2024-01-18 10:59:01 +00:00

65 lines
1.0 KiB
Kotlin
Vendored

fun topLevelMethod() {
var z: Int = 1
when {
true -> { // BLOCK
z = 2
}
else -> { // BLOCK
z = 3
}
}
when {
true -> z = 4
else -> z = 5
}
when {
true -> { // BLOCK
z = z.plus(other = 6)
}
else -> { // BLOCK
z = z.plus(other = 7)
}
}
when {
true -> z = z.plus(other = 8)
else -> z = z.plus(other = 9)
}
{ // BLOCK
val tmp_0: Int = z
when {
EQEQ(arg0 = tmp_0, arg1 = 1) -> { // BLOCK
z = 10
}
else -> { // BLOCK
z = 11
}
}
}
{ // BLOCK
val tmp_1: Int = z
when {
EQEQ(arg0 = tmp_1, arg1 = 1) -> z = 12
else -> z = 13
}
}
{ // BLOCK
val tmp_2: Int = z
when {
EQEQ(arg0 = tmp_2, arg1 = 1) -> { // BLOCK
z = z.plus(other = 14)
}
else -> { // BLOCK
z = z.plus(other = 15)
}
}
}
{ // BLOCK
val tmp_3: Int = z
when {
EQEQ(arg0 = tmp_3, arg1 = 1) -> z = z.plus(other = 16)
else -> z = z.plus(other = 17)
}
}
}