FIR checker: report VAL_REASSIGNMENT_VIA_BACKING_FIELD(_ERROR)

This commit is contained in:
Jinseong Jeon
2021-03-15 23:14:00 +03:00
committed by Mikhail Glukhikh
parent a6d11b8914
commit 93289aa899
19 changed files with 149 additions and 62 deletions
@@ -1,23 +0,0 @@
// !LANGUAGE: +RestrictionOfValReassignmentViaBackingField
package a
import java.util.HashSet
val a: MutableSet<String>? = null
get() {
if (a == null) {
field = HashSet()
}
return a
}
class R {
val b: String? = null
get() {
if (b == null) {
field = "b"
}
return b
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +RestrictionOfValReassignmentViaBackingField
package a
@@ -1,23 +0,0 @@
// !LANGUAGE: -RestrictionOfValReassignmentViaBackingField
package a
import java.util.HashSet
val a: MutableSet<String>? = null
get() {
if (a == null) {
field = HashSet()
}
return a
}
class R {
val b: String? = null
get() {
if (b == null) {
field = "b"
}
return b
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: -RestrictionOfValReassignmentViaBackingField
package a