FIR checker: rework VAL_REASSIGNMENT_VIA_BACKING_FIELD(_ERROR)

This commit is contained in:
Jinseong Jeon
2021-03-19 10:52:45 -07:00
committed by TeamCityServer
parent 4f1ed2f112
commit c6298398ef
6 changed files with 86 additions and 36 deletions
@@ -0,0 +1,34 @@
// !LANGUAGE: +RestrictionOfValReassignmentViaBackingField
class Outer {
val i: Int = 1
get() {
class Inner {
var i: Int = 2
get() {
field++
return field
}
val j: Int = 3
get() {
<!VAL_REASSIGNMENT_VIA_BACKING_FIELD_ERROR!>field<!> = 42
return field
}
fun innerMember() {
<!VAL_REASSIGNMENT_VIA_BACKING_FIELD_ERROR!>field<!>++
}
}
return field
}
val j: Int = 4
get() {
fun local() {
<!VAL_REASSIGNMENT_VIA_BACKING_FIELD_ERROR!>field<!>++
<!VAL_REASSIGNMENT_VIA_BACKING_FIELD_ERROR!>field<!>++
}
local()
return field
}
}
@@ -1,4 +1,3 @@
// FIR_IDENTICAL
// !LANGUAGE: +RestrictionOfValReassignmentViaBackingField
class Outer {