Better implementation of "Move lambda outside parenthesis"

This commit is contained in:
Valentin Kipyatkov
2015-05-22 13:54:52 +03:00
parent 3bca1d1f83
commit d7c64d44b6
10 changed files with 57 additions and 49 deletions
@@ -3,7 +3,7 @@
// ERROR: Unresolved reference: it
fun foo() {
bar <caret>{ it }
bar<caret> { it }
}
fun bar(a: Int = 0, f: (Int) -> Int) { }
@@ -1,3 +1,3 @@
fun foo(p: (Int, () -> Int) -> Unit) {
p(1) <caret>{ 2 }
p(1<caret>) { 2 }
}
@@ -0,0 +1,6 @@
// IS_APPLICABLE: false
fun foo() {
bar(<caret>{ it }) {it}
}
fun bar(p1: (Int) -> Int, p2: (Int) -> Int) { }
@@ -3,7 +3,7 @@ fun bar(a: Int, b: Int, f: () -> Unit) {}
fun foo(a: Int, b: Int) = 2
fun test() {
bar(1, 2) {
bar(1, 2 /* , , */) {
val a = foo(1, 2)
}
}