FIR checkers: report VAL_REASSIGNMENT for assignment operators

Currently VAL_REASSIGNMENT are only reported on direct assignments.
Reassignments in the form of, for example, `+=` are reported as
`VARIABLE_EXPECTED`, which differs from FE1.0.
This commit is contained in:
Tianyu Geng
2021-03-30 16:23:39 -07:00
committed by Mikhail Glukhikh
parent b87a943efd
commit fc8d0e3ee0
17 changed files with 57 additions and 38 deletions
@@ -6,6 +6,6 @@ FILE: fieldPlusAssign.kt
}
public final val y: R|kotlin/Int| = Int(1)
public get(): R|kotlin/Int| {
<Variable expected># = F|/y|.R|kotlin/Int.plus|(Int(1))
<Re-assigning a val variable># = F|/y|.R|kotlin/Int.plus|(Int(1))
^ Int(1)
}
@@ -5,6 +5,6 @@ var x: Int = 1
val y: Int = 1
get() {
<!VARIABLE_EXPECTED!>field<!> += 1
<!VAL_REASSIGNMENT_VIA_BACKING_FIELD_ERROR!>field<!> += 1
return 1
}