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
@@ -103,7 +103,7 @@ class Test() {
a += 34
(l@ a) += 34
<!VARIABLE_EXPECTED!>b<!> += 34
<!VAL_REASSIGNMENT!>b<!> += 34
a++
(l@ a)++
@@ -113,9 +113,9 @@ class Test() {
fun testVariables1() {
val b: Int = 34
(l@ <!VARIABLE_EXPECTED!>b<!>) += 34
(l@ <!VAL_REASSIGNMENT!>b<!>) += 34
//repeat for b
(<!VARIABLE_EXPECTED!>b<!>) += 3
(<!VAL_REASSIGNMENT!>b<!>) += 3
}
fun testArrays(a: Array<Int>, ab: Ab) {