Supported renaming default objects with default names.

This commit is contained in:
Evgeny Gerashchenko
2015-03-12 21:51:29 +03:00
parent ccd1701f78
commit 510974e07c
11 changed files with 81 additions and 2 deletions
@@ -0,0 +1,8 @@
class JavaUsage {
public static void main(String[] args) {
System.out.println(Foo.CONST);
Foo.s();
Foo.Baz.f();
Foo foo = new Foo(); // not usage of default object
}
}
@@ -0,0 +1,11 @@
class Foo {
default object Baz {
fun f() {
}
platformStatic fun s() {
}
val CONST = 42
}
}
@@ -0,0 +1,8 @@
fun main(args: Array<String>) {
// class object usages
Foo.f()
val x = Foo
Foo.Baz.f()
val xx = Foo.Baz
}
@@ -0,0 +1,8 @@
class JavaUsage {
public static void main(String[] args) {
System.out.println(Foo.CONST);
Foo.s();
Foo.Default.f();
Foo foo = new Foo(); // not usage of default object
}
}
@@ -0,0 +1,11 @@
class Foo {
default object {
fun f() {
}
platformStatic fun s() {
}
val CONST = 42
}
}
@@ -0,0 +1,8 @@
fun main(args: Array<String>) {
// class object usages
Foo.f()
val x = Foo
Foo.Default.f()
val xx = Foo.Default
}
@@ -0,0 +1,7 @@
{
"type": "KOTLIN_CLASS",
"classId": "/Foo.Default",
"oldName": "Default",
"newName": "Baz",
"mainFile": "toBeRenamed.kt"
}