Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolve/arguments/fieldPlusAssign.fir.txt
T
Tianyu Geng fc8d0e3ee0 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.
2021-04-02 13:33:52 +03:00

12 lines
434 B
Plaintext
Vendored

FILE: fieldPlusAssign.kt
public final var x: R|kotlin/Int| = Int(1)
public get(): R|kotlin/Int|
public set(value: R|kotlin/Int|): R|kotlin/Unit| {
F|/x| = F|/x|.R|kotlin/Int.plus|(R|<local>/value|)
}
public final val y: R|kotlin/Int| = Int(1)
public get(): R|kotlin/Int| {
<Re-assigning a val variable># = F|/y|.R|kotlin/Int.plus|(Int(1))
^ Int(1)
}