Function literal expression outside the parentheses wrapped into JetFunctionLiteralArgument

Extracted JetFunctionLiteralArgument.moveInsideParenthesesAndReplaceWith util function
This commit is contained in:
Svetlana Isakova
2014-07-12 20:03:38 +04:00
parent 4477a96ca7
commit 2ae87cae4a
59 changed files with 1040 additions and 912 deletions
@@ -0,0 +1,8 @@
// IS_APPLICABLE: true
fun foo() {
bar(2) <caret>@l{ it * 3 }
}
fun bar(a: Int, b: (Int) -> Int) {
b(a)
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: true
fun foo() {
bar(2, @l{ it * 3 })
}
fun bar(a: Int, b: (Int) -> Int) {
b(a)
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: true
fun foo() {
bar <caret>@l{ it * 3 }
}
fun bar(b: (Int) -> Int) {
b(42)
}
@@ -0,0 +1,8 @@
// IS_APPLICABLE: true
fun foo() {
bar(@l{ it * 3 })
}
fun bar(b: (Int) -> Int) {
b(42)
}