fix: val can be reassigned through backing field inside its own getter
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package a
|
||||
|
||||
import java.util.HashSet
|
||||
|
||||
val a: MutableSet<String>? = null
|
||||
get() {
|
||||
if (a == null) {
|
||||
$a = HashSet()
|
||||
}
|
||||
return a
|
||||
}
|
||||
|
||||
class R {
|
||||
val b: String? = null
|
||||
get() {
|
||||
if (b == null) {
|
||||
$b = "b"
|
||||
}
|
||||
return b
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user