KT-18482: "Move lambda argument to parenthesis" action generate uncompilable code fixed (#1226)

* KT-18482 fixed

* Moved code to separate method and changed code to cover few more cases.

* Code style fixes.
This commit is contained in:
Dimach
2017-08-07 16:43:44 +03:00
committed by Dmitry Jemerov
parent a4551fb0fb
commit d624ed4aff
6 changed files with 71 additions and 9 deletions
@@ -0,0 +1,10 @@
// IS_APPLICABLE: true
fun foo() {
bar <caret>{
it * 3
}
}
fun bar(a : Int = 2, b: (Int) -> Int) {
b(a)
}
@@ -0,0 +1,10 @@
// IS_APPLICABLE: true
fun foo() {
bar(b = {
it * 3
})
}
fun bar(a : Int = 2, b: (Int) -> Int) {
b(a)
}
@@ -0,0 +1,10 @@
// IS_APPLICABLE: true
fun foo() {
bar(1) <caret>{
it * 3
}
}
fun bar(c: Int, a: Int = 2, b: (Int) -> Int) {
b(a)
}
@@ -0,0 +1,10 @@
// IS_APPLICABLE: true
fun foo() {
bar(1, b = {
it * 3
})
}
fun bar(c: Int, a: Int = 2, b: (Int) -> Int) {
b(a)
}