when renaming a companion object, filter out references to companion object via its containing class, which shouldn't be updated by the rename
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
class JavaUsage {
|
||||
public static void main(String[] args) {
|
||||
System.out.println(Foo.CONST);
|
||||
Foo.s();
|
||||
Foo.Bar.f();
|
||||
Foo foo = new Foo(); // not usage of companion object
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class Foo {
|
||||
companion object Bar {
|
||||
fun f() {
|
||||
}
|
||||
|
||||
platformStatic fun s() {
|
||||
}
|
||||
|
||||
val CONST = 42
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun main(args: Array<String>) {
|
||||
// companion object usages
|
||||
Foo.f()
|
||||
val x = Foo
|
||||
|
||||
Foo.Bar.f()
|
||||
val xx = Foo.Bar
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
class JavaUsage {
|
||||
public static void main(String[] args) {
|
||||
System.out.println(Foo.CONST);
|
||||
Foo.s();
|
||||
Foo.Bar.f();
|
||||
Foo foo = new Foo(); // not usage of companion object
|
||||
}
|
||||
}
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
class Foo {
|
||||
companion object Foo {
|
||||
fun f() {
|
||||
}
|
||||
|
||||
platformStatic fun s() {
|
||||
}
|
||||
|
||||
val CONST = 42
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
fun main(args: Array<String>) {
|
||||
// companion object usages
|
||||
Foo.f()
|
||||
val x = Foo
|
||||
|
||||
Foo.Foo.f()
|
||||
val xx = Foo.Foo
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"type": "KOTLIN_CLASS",
|
||||
"classId": "/Foo.Foo",
|
||||
"oldName": "Foo",
|
||||
"newName": "Bar",
|
||||
"mainFile": "toBeRenamed.kt"
|
||||
}
|
||||
Reference in New Issue
Block a user