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"
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
package test;
|
||||
|
||||
class J {
|
||||
void test(C.O companion) {
|
||||
companion.getFoo();
|
||||
companion.setFoo(1);
|
||||
|
||||
C.getFoo();
|
||||
C.setFoo(2);
|
||||
}
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package test
|
||||
|
||||
class C {
|
||||
companion object O {
|
||||
@JvmStatic
|
||||
var foo: Int = 1
|
||||
}
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
package test;
|
||||
|
||||
class J {
|
||||
void test(C.O companion) {
|
||||
companion.getFoo();
|
||||
companion.setFoo(1);
|
||||
|
||||
C.O.getFoo();
|
||||
C.O.setFoo(2);
|
||||
}
|
||||
}
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
package test
|
||||
|
||||
class C {
|
||||
companion object O {
|
||||
var <caret>foo: Int = 1
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user