Extract Function: Generate named argument for extracted lambda (when necessary)
This commit is contained in:
+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(a = 1, b = 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(a = 1, b = 2, f = function())
|
||||
}
|
||||
|
||||
private fun function(): (Int) -> Boolean {
|
||||
return { it + 1 > 1 }
|
||||
}
|
||||
Reference in New Issue
Block a user