Inline val: more correct and simple detection of write usages
#KT-17489 Fixed
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
class Predicate(val x: Int) {
|
||||
operator fun plusAssign(y: Int) {}
|
||||
|
||||
operator fun unaryMinus() = Predicate(-x)
|
||||
}
|
||||
|
||||
fun test(p: Predicate) {
|
||||
val <caret>x = -p
|
||||
x += 42
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
class Predicate(val x: Int) {
|
||||
operator fun plusAssign(y: Int) {}
|
||||
|
||||
operator fun unaryMinus() = Predicate(-x)
|
||||
}
|
||||
|
||||
fun test(p: Predicate) {
|
||||
-p += 42
|
||||
}
|
||||
Reference in New Issue
Block a user