Rename: Fix processing of references to synthetic Java properties

#KT-17742 Fixed
This commit is contained in:
Alexey Sedunov
2018-03-05 13:54:14 +03:00
parent 862dc76ed9
commit 8978c4b9e8
19 changed files with 256 additions and 65 deletions
@@ -0,0 +1,4 @@
public class SyntheticProperty {
public int getSyntheticA() { return 1; }
public void foo(int x) { }
}
@@ -0,0 +1,12 @@
fun synthesize(p: SyntheticProperty) {
val v1 = p.syntheticA
p.foo(1)
p.foo(p.syntheticA + 2)
p.foo(p.syntheticA.inc())
val syntheticA = p.syntheticA
p.foo(syntheticA.inc())
val x = syntheticA
val i = p.syntheticA.inc()
p.foo(i)
val y = i
}
@@ -0,0 +1,4 @@
public class SyntheticProperty {
public int getSyntheticA() { return 1; }
public void /*rename*/setSyntheticA(int x) { }
}
@@ -0,0 +1,8 @@
fun synthesize(p: SyntheticProperty) {
val v1 = p.syntheticA
p.syntheticA = 1
p.syntheticA += 2
p.syntheticA++
val x = p.syntheticA++
val y = ++p.syntheticA
}
@@ -0,0 +1,6 @@
{
"type": "AUTO_DETECT",
"mainFile": "SyntheticProperty.java",
"newName": "foo",
"withRuntime": "true"
}