Extract Function: Support multiple output values
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
// WITH_RUNTIME
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
// PARAM_DESCRIPTOR: value-parameter val a: kotlin.Int defined in foo
|
||||
// PARAM_DESCRIPTOR: var b: kotlin.Int defined in foo
|
||||
// PARAM_DESCRIPTOR: var c: kotlin.Int defined in foo
|
||||
// SIBLING:
|
||||
fun foo(a: Int): Int {
|
||||
var b: Int = 1
|
||||
var c: Int = 1
|
||||
|
||||
<selection>when {
|
||||
a > 0 -> {
|
||||
b += a
|
||||
}
|
||||
else -> {
|
||||
c -= a
|
||||
}
|
||||
}
|
||||
println(b)
|
||||
println(c)</selection>
|
||||
|
||||
return b + c
|
||||
}
|
||||
Reference in New Issue
Block a user