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:
@@ -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)
|
||||
}
|
||||
Reference in New Issue
Block a user