Add @JvmStatic Intention: Support functions/properties in objects
Also eliminate unnecessary object instance references on Java call sites #KT-20095 Fixed
This commit is contained in:
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"mainFile": "test/test.kt",
|
||||
"intentionClass": "org.jetbrains.kotlin.idea.intentions.AddJvmStaticIntention",
|
||||
"withRuntime": "true"
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package test;
|
||||
|
||||
class J {
|
||||
void test(C.Companion companion) {
|
||||
companion.foo("x");
|
||||
C.foo("y");
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package test
|
||||
|
||||
class C {
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun foo(s: String) {}
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package test;
|
||||
|
||||
class J {
|
||||
void test(C.Companion companion) {
|
||||
companion.foo("x");
|
||||
C.Companion.foo("y");
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
class C {
|
||||
companion object {
|
||||
fun <caret>foo(s: String) {}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user