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:
Dmitry Jemerov
2015-08-27 18:43:44 +02:00
parent e99316d22e
commit e283dbb8f4
9 changed files with 88 additions and 0 deletions
@@ -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
}
}
@@ -0,0 +1,11 @@
class Foo {
companion object Bar {
fun f() {
}
platformStatic fun s() {
}
val CONST = 42
}
}
@@ -0,0 +1,8 @@
fun main(args: Array<String>) {
// companion object usages
Foo.f()
val x = Foo
Foo.Bar.f()
val xx = Foo.Bar
}
@@ -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
}
}
@@ -0,0 +1,11 @@
class Foo {
companion object Foo {
fun f() {
}
platformStatic fun s() {
}
val CONST = 42
}
}
@@ -0,0 +1,8 @@
fun main(args: Array<String>) {
// companion object usages
Foo.f()
val x = Foo
Foo.Foo.f()
val xx = Foo.Foo
}
@@ -0,0 +1,7 @@
{
"type": "KOTLIN_CLASS",
"classId": "/Foo.Foo",
"oldName": "Foo",
"newName": "Bar",
"mainFile": "toBeRenamed.kt"
}