fa8c6e7fb6
* 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>
31 lines
550 B
Kotlin
Vendored
31 lines
550 B
Kotlin
Vendored
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--
|
|
}
|