Merge pull request #472 from wutalman/move_lambda

KT-4889: (Bug fix) Intention to move lambda outside parentheses now handles commas
This commit is contained in:
Svetlana Isakova
2014-05-29 17:11:41 +04:00
8 changed files with 90 additions and 9 deletions
@@ -0,0 +1,9 @@
// IS_APPLICABLE: true
fun bar(f: () -> Unit) {}
fun foo(a: Int, b: Int) = 2
fun test() {
bar({
<caret>val a = foo(1, 2)
})
}
@@ -0,0 +1,9 @@
// IS_APPLICABLE: true
fun bar(f: () -> Unit) {}
fun foo(a: Int, b: Int) = 2
fun test() {
bar {
val a = foo(1, 2)
}
}
@@ -0,0 +1,9 @@
// IS_APPLICABLE: true
fun bar(x: Int, f: () -> Unit) {}
fun foo(a: Int, b: Int) = 2
fun test() {
bar(1, {
<caret>val a = foo(1, 2)
})
}
@@ -0,0 +1,9 @@
// IS_APPLICABLE: true
fun bar(x: Int, f: () -> Unit) {}
fun foo(a: Int, b: Int) = 2
fun test() {
bar(1) {
val a = foo(1, 2)
}
}
@@ -0,0 +1,9 @@
// IS_APPLICABLE: true
fun bar(a: Int, b: Int, f: () -> Unit) {}
fun foo(a: Int, b: Int) = 2
fun test() {
bar(1, 2, /* , , */ {
<caret>val a = foo(1, 2)
})
}
@@ -0,0 +1,9 @@
// IS_APPLICABLE: true
fun bar(a: Int, b: Int, f: () -> Unit) {}
fun foo(a: Int, b: Int) = 2
fun test() {
bar(1, 2) {
val a = foo(1, 2)
}
}