Extract Function: Fix call replacement for the case of lambda extraction
This commit is contained in:
+6
@@ -0,0 +1,6 @@
|
||||
fun <T> Array<T>.check(f: (T) -> Boolean): Boolean = false
|
||||
|
||||
// SIBLING:
|
||||
fun foo(t: Array<Int>) {
|
||||
t.check() <selection>{ it + 1 > 1 }</selection>
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
fun <T> Array<T>.check(f: (T) -> Boolean): Boolean = false
|
||||
|
||||
// SIBLING:
|
||||
fun foo(t: Array<Int>) {
|
||||
t.check(function())
|
||||
}
|
||||
|
||||
fun function(): (Int) -> Boolean {
|
||||
return { it + 1 > 1 }
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
fun <T> Array<T>.check(f: (T) -> Boolean): Boolean = false
|
||||
|
||||
// SIBLING:
|
||||
fun foo(t: Array<Int>) {
|
||||
t.check <selection>{ it + 1 > 1 }</selection>
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
fun <T> Array<T>.check(f: (T) -> Boolean): Boolean = false
|
||||
|
||||
// SIBLING:
|
||||
fun foo(t: Array<Int>) {
|
||||
t.check(function())
|
||||
}
|
||||
|
||||
fun function(): (Int) -> Boolean {
|
||||
return { it + 1 > 1 }
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
fun <T> Array<T>.check(a: Int, b: Int f: (T) -> Boolean): Boolean = false
|
||||
|
||||
// SIBLING:
|
||||
fun foo(t: Array<Int>) {
|
||||
t.check(1, 2) <selection>{ it + 1 > 1 }</selection>
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
fun <T> Array<T>.check(a: Int, b: Int f: (T) -> Boolean): Boolean = false
|
||||
|
||||
// SIBLING:
|
||||
fun foo(t: Array<Int>) {
|
||||
t.check(1, 2, function())
|
||||
}
|
||||
|
||||
fun function(): (Int) -> Boolean {
|
||||
return { it + 1 > 1 }
|
||||
}
|
||||
Reference in New Issue
Block a user