FIR checker: report VAL_REASSIGNMENT_VIA_BACKING_FIELD(_ERROR)
This commit is contained in:
committed by
Mikhail Glukhikh
parent
a6d11b8914
commit
93289aa899
Vendored
-23
@@ -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
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +RestrictionOfValReassignmentViaBackingField
|
||||
|
||||
package a
|
||||
|
||||
Vendored
-23
@@ -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
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -RestrictionOfValReassignmentViaBackingField
|
||||
|
||||
package a
|
||||
|
||||
Reference in New Issue
Block a user