Rename: @JvmName support

#KT-8044 Fixed
 #KT-9432 Fixed
This commit is contained in:
Alexey Sedunov
2016-05-25 15:26:03 +03:00
parent ff4c16d342
commit 96132fa61a
198 changed files with 1928 additions and 87 deletions
@@ -0,0 +1,7 @@
package test;
class Test {
{
Foo.foo();
}
}
@@ -0,0 +1,8 @@
// test
@file:JvmName("Foo")
package test
fun foo() {
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
/*rename*/TestKt.foo();
}
}
@@ -0,0 +1,6 @@
// test
package test
fun foo() {
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "Foo",
"withRuntime": "true",
"byRef": "true"
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
Foo.foo();
}
}
@@ -0,0 +1,7 @@
@file:JvmMultifileClass @file:JvmName("Foo")
package test
fun foo() {
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
/*rename*/TestKt.foo();
}
}
@@ -0,0 +1,6 @@
@file:JvmMultifileClass
package test
fun foo() {
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "Foo",
"withRuntime": "true",
"byRef": "true"
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
Foo.foo();
}
}
@@ -0,0 +1,7 @@
@file:JvmName("Foo")
package test
fun foo() {
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
/*rename*/TestKt.foo();
}
}
@@ -0,0 +1,5 @@
package test
fun foo() {
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "Foo",
"withRuntime": "true",
"byRef": "true"
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
FooKt.foo();
}
}
@@ -0,0 +1,5 @@
package test
fun foo() {
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
/*rename*/TestKt.foo();
}
}
@@ -0,0 +1,5 @@
package test
fun foo() {
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "FooKt",
"withRuntime": "true",
"byRef": "true"
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
Bar.foo();
}
}
@@ -0,0 +1,6 @@
@file:JvmName("Bar")
package test
fun foo() {
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
/*rename*/Foo.foo();
}
}
@@ -0,0 +1,6 @@
@file:JvmName("Foo")
package test
fun foo() {
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "Bar",
"withRuntime": "true",
"byRef": "true"
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
TestKt.foo();
}
}
@@ -0,0 +1,5 @@
package test
fun foo() {
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
/*rename*/Foo.foo();
}
}
@@ -0,0 +1,6 @@
@file:JvmName("Foo")
package test
fun foo() {
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "TestKt",
"withRuntime": "true",
"byRef": "true"
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
new A().foo();
}
}
@@ -0,0 +1,10 @@
package test
class A {
@JvmName("foo")
fun second() = 1
}
fun test() {
A().second()
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
new A().foo();
}
}
@@ -0,0 +1,10 @@
package test
class A {
@JvmName("foo")
fun /*rename*/first() = 1
}
fun test() {
A().first()
}
@@ -0,0 +1,6 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/test.kt",
"newName": "second",
"withRuntime": "true"
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
new A().bar();
}
}
@@ -0,0 +1,10 @@
package test
class A {
@JvmName("bar")
fun first() = 1
}
fun test() {
A().first()
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
new A()./*rename*/foo();
}
}
@@ -0,0 +1,10 @@
package test
class A {
@JvmName("foo")
fun first() = 1
}
fun test() {
A().first()
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "bar",
"withRuntime": "true",
"byRef": "true"
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
new A().first();
}
}
@@ -0,0 +1,9 @@
package test
class A {
fun first() = 1
}
fun test() {
A().first()
}
@@ -0,0 +1,7 @@
package test;
class Test {
{
new A()./*rename*/foo();
}
}
@@ -0,0 +1,10 @@
package test
class A {
@JvmName("foo")
fun first() = 1
}
fun test() {
A().first()
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "first",
"withRuntime": "true",
"byRef": "true"
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
Bar.foo();
Bar.foo2();
}
}
@@ -0,0 +1,7 @@
@file:JvmMultifileClass
@file:JvmName("Bar")
package test
fun foo() {
}
@@ -0,0 +1,7 @@
@file:JvmMultifileClass
@file:JvmName("Bar")
package test
fun foo2() {
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
/*rename*/Foo.foo();
Foo.foo2();
}
}
@@ -0,0 +1,7 @@
@file:JvmMultifileClass
@file:JvmName("Foo")
package test
fun foo() {
}
@@ -0,0 +1,7 @@
@file:JvmMultifileClass
@file:JvmName("Foo")
package test
fun foo2() {
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "Bar",
"withRuntime": "true",
"byRef": "true"
}
@@ -1,3 +0,0 @@
package testing.rename
fun test() = 12
@@ -1,9 +0,0 @@
package testing;
import testing.rename.RenameKotlinClassKt;
class JavaClient {
void foo() {
RenameKotlinClassKt.test();
}
}
@@ -1,3 +0,0 @@
package testing.rename
fun test() = 12
@@ -1,9 +0,0 @@
package testing;
import testing.rename.RenameKotlinClassKt;
class JavaClient {
void foo() {
RenameKotlinClassKt.test();
}
}
@@ -1,6 +0,0 @@
{
"type": "JAVA_CLASS",
"hint": "Can\u0027t rename Kotlin package facade class",
"classId": "testing/rename/RenameKotlinClassKt",
"newName": "NewPackageName"
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().getFoo();
new A().setSecond(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@get:JvmName("getFoo") var second: Int = 1)
fun test() {
A().second
A().second = 1
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().getFoo();
new A().setFirst(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@get:JvmName("getFoo") var /*rename*/first: Int = 1)
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,6 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/test.kt",
"newName": "second",
"withRuntime": "true"
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().getFooNew();
new A().setFirst(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@get:JvmName("getFooNew") var first: Int = 1)
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A()./*rename*/getFoo();
new A().setFirst(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@get:JvmName("getFoo") var first: Int = 1)
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "getFooNew",
"withRuntime": "true",
"byRef": "true"
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().getFoo();
new A().setSecond(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@get:JvmName("getFoo") var second: Int = 1)
fun test() {
A().second
A().second = 1
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().getFoo();
new A()./*rename*/setFirst(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@get:JvmName("getFoo") var first: Int = 1)
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "second",
"withRuntime": "true",
"byRef": "true"
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().getFirst();
new A().setFirst(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(var first: Int = 1)
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A()./*rename*/getFoo();
new A().setFirst(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@get:JvmName("getFoo") var first: Int = 1)
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "getFirst",
"withRuntime": "true",
"byRef": "true"
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().getFoo();
new A().setBar(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@get:JvmName("getFoo") @set:JvmName("setBar") var second: Int = 1)
fun test() {
A().second
A().second = 1
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().getFoo();
new A().setBar(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@get:JvmName("getFoo") @set:JvmName("setBar") var /*rename*/first: Int = 1)
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,6 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/test.kt",
"newName": "second",
"withRuntime": "true"
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().getFooNew();
new A().setBar(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@get:JvmName("getFooNew") @set:JvmName("setBar") var first: Int = 1)
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A()./*rename*/getFoo();
new A().setBar(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@get:JvmName("getFoo") @set:JvmName("setBar") var first: Int = 1)
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "getFooNew",
"withRuntime": "true",
"byRef": "true"
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().getFoo();
new A().setBarNew(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@get:JvmName("getFoo") @set:JvmName("setBarNew") var first: Int = 1)
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().getFoo();
new A()./*rename*/setBar(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@get:JvmName("getFoo") @set:JvmName("setBar") var first: Int = 1)
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "setBarNew",
"withRuntime": "true",
"byRef": "true"
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().getFirst();
new A().setBar(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@set:JvmName("setBar") var first: Int = 1)
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A()./*rename*/getFoo();
new A().setBar(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@get:JvmName("getFoo") @set:JvmName("setBar") var first: Int = 1)
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "getFirst",
"withRuntime": "true",
"byRef": "true"
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().getFoo();
new A().setFirst(1);
}
}
@@ -0,0 +1,8 @@
package test
class A(@get:JvmName("getFoo") var first: Int = 1)
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().getFoo();
new A()./*rename*/setBar(1);
}
}

Some files were not shown because too many files have changed in this diff Show More