Light Classes: Support property accessors with non-conventional names

#KT-13032 Fixed
This commit is contained in:
Alexey Sedunov
2016-08-15 20:13:01 +03:00
parent 94c4b426f5
commit fbd6edce92
16 changed files with 126 additions and 5 deletions
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().fooNew();
new A().bar(1);
}
}
@@ -0,0 +1,12 @@
package test
class A {
@get:JvmName("fooNew")
@set:JvmName("bar")
var first = 1
}
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A()./*rename*/foo();
new A().bar(1);
}
}
@@ -0,0 +1,12 @@
package test
class A {
@get:JvmName("foo")
@set:JvmName("bar")
var first = 1
}
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "fooNew",
"withRuntime": "true",
"byRef": "true"
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().foo();
new A().barNew(1);
}
}
@@ -0,0 +1,12 @@
package test
class A {
@get:JvmName("foo")
@set:JvmName("barNew")
var first = 1
}
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
new A().foo();
new A()./*rename*/bar(1);
}
}
@@ -0,0 +1,12 @@
package test
class A {
@get:JvmName("foo")
@set:JvmName("bar")
var first = 1
}
fun test() {
A().first
A().first = 1
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaClient.java",
"newName": "barNew",
"withRuntime": "true",
"byRef": "true"
}
@@ -785,6 +785,18 @@ public class RenameTestGenerated extends AbstractRenameTest {
doTest(fileName);
}
@TestMetadata("renameKotlinPropertyWithCustomGetterSetterJvmNameByGetterRef/renameKotlinPropertyWithCustomGetterSetterJvmNameByGetterRef.test")
public void testRenameKotlinPropertyWithCustomGetterSetterJvmNameByGetterRef_RenameKotlinPropertyWithCustomGetterSetterJvmNameByGetterRef() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/rename/renameKotlinPropertyWithCustomGetterSetterJvmNameByGetterRef/renameKotlinPropertyWithCustomGetterSetterJvmNameByGetterRef.test");
doTest(fileName);
}
@TestMetadata("renameKotlinPropertyWithCustomGetterSetterJvmNameBySetterRef/renameKotlinPropertyWithCustomGetterSetterJvmNameBySetterRef.test")
public void testRenameKotlinPropertyWithCustomGetterSetterJvmNameBySetterRef_RenameKotlinPropertyWithCustomGetterSetterJvmNameBySetterRef() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/rename/renameKotlinPropertyWithCustomGetterSetterJvmNameBySetterRef/renameKotlinPropertyWithCustomGetterSetterJvmNameBySetterRef.test");
doTest(fileName);
}
@TestMetadata("renameKotlinPropertyWithGetterJvmName/renameKotlinPropertyWithGetterJvmName.test")
public void testRenameKotlinPropertyWithGetterJvmName_RenameKotlinPropertyWithGetterJvmName() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/refactoring/rename/renameKotlinPropertyWithGetterJvmName/renameKotlinPropertyWithGetterJvmName.test");