Extract method refactoring should order parameters by first usage
Fixes #KT-16198
This commit is contained in:
+3
-3
@@ -2,22 +2,22 @@
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
// PARAM_DESCRIPTOR: value-parameter a: kotlin.Int defined in foo
|
||||
// PARAM_DESCRIPTOR: var b: kotlin.Int defined in foo
|
||||
// PARAM_DESCRIPTOR: value-parameter a: 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
|
||||
|
||||
val pair = pair(a, b, c)
|
||||
val pair = pair(b, a, c)
|
||||
b = pair.first
|
||||
c = pair.second
|
||||
|
||||
return b + c
|
||||
}
|
||||
|
||||
private fun pair(a: Int, b: Int, c: Int): Pair<Int, Int> {
|
||||
private fun pair(b: Int, a: Int, c: Int): Pair<Int, Int> {
|
||||
var b1 = b
|
||||
var c1 = c
|
||||
b1 += a
|
||||
|
||||
Reference in New Issue
Block a user