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"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package test;
|
||||
|
||||
class J {
|
||||
void test(O o) {
|
||||
o.foo("x");
|
||||
O.foo("y");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package test
|
||||
|
||||
object O {
|
||||
@JvmStatic
|
||||
fun foo(s: String) {}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package test;
|
||||
|
||||
class J {
|
||||
void test(O o) {
|
||||
o.foo("x");
|
||||
O.INSTANCE.foo("y");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package test
|
||||
|
||||
object O {
|
||||
fun <caret>foo(s: String) {}
|
||||
}
|
||||
Reference in New Issue
Block a user