Uast: KT-40578: resolve Kotlin property writes to setters (#3597)
* KT-40578: resolve Kotlin property writes to setters * limit to non-constructor properties * Uast: `KotlinIDERenderLogTest.testConstructors` fix Co-authored-by: Nicolay Mitropolsky <nicolay.mitropolsky@jetbrains.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
class A(init: Int) {
|
||||
private var privateProp = 0 // accesses should be field accesses
|
||||
var mutableProp: Int
|
||||
init {
|
||||
mutableProp = init
|
||||
}
|
||||
|
||||
fun add(x: Int): Int {
|
||||
val result = privateProp
|
||||
privateProp = x
|
||||
return privateProp
|
||||
}
|
||||
}
|
||||
|
||||
fun properties() {
|
||||
val a = A(17)
|
||||
val x = -a.mutableProp
|
||||
a.mutableProp = 1
|
||||
a.mutableProp += x
|
||||
++a.mutableProp
|
||||
a.mutableProp--
|
||||
}
|
||||
|
||||
fun A.ext() {
|
||||
val x = -mutableProp
|
||||
mutableProp = 1
|
||||
mutableProp += x
|
||||
++mutableProp
|
||||
mutableProp--
|
||||
}
|
||||
Reference in New Issue
Block a user