Convert Object Literal to Lambda Intention: Move lambda out of parentheses when possible. Fix after-template
#KT-10778 Fixed
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
package source;
|
||||
|
||||
public class J {
|
||||
static void foo(Runnable r, int n) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package source
|
||||
|
||||
fun bar() {
|
||||
J.foo({ println("a") }, 1)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package source;
|
||||
|
||||
public class J {
|
||||
static void foo(Runnable r, int n) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package source
|
||||
|
||||
fun bar() {
|
||||
J.foo(<caret>object : Runnable {
|
||||
override fun run() {
|
||||
println("a")
|
||||
}
|
||||
}, 1)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"mainFile": "source/test.kt",
|
||||
"intentionClass": "org.jetbrains.kotlin.idea.intentions.ObjectLiteralToLambdaIntention",
|
||||
"intentionText": "Convert to lambda",
|
||||
"withRuntime": "true"
|
||||
}
|
||||
Reference in New Issue
Block a user