Files
kotlin-fork/idea/testData/refactoring/extractFunction/controlFlow/outputValues/singleOutputValueWithWhenElse.kt.after
T

25 lines
333 B
Plaintext

// SIBLING:
fun foo(a: Int): Int {
var b: Int = 1
b = i(a, b)
return b
}
fun i(a: Int, b: Int): Int {
var b1 = b
when {
a > 0 -> {
b1 = b1 + 1
}
a < 0 -> {
b1 = b1 - 1
}
else -> {
b1 = a
}
}
println(b1)
return b1
}