Files
kotlin-fork/idea/testData/refactoring/extractFunction/controlFlow/outputValues/singleOutputValueWithWhen.kt
T
2014-06-23 21:10:12 +04:00

18 lines
299 B
Kotlin

// PARAM_TYPES: kotlin.Int, Comparable<Int>
// PARAM_TYPES: kotlin.Int
// SIBLING:
fun foo(a: Int): Int {
var b: Int = 1
<selection> when {
a > 0 -> {
b = b + 1
}
a < 0 -> {
b = b - 1
}
}
println(b)</selection>
return b
}