FIR: check assignments and references to members in constructors
I.e. emit VAL_REASSIGNMENT on repeated assignments to `this.something`, UNINITIALIZED_VARIABLE on reads of it before any assignment if there is no initializer, and CAPTURED_MEMBER_VAL_INITIALIZATION on assignments inside non-called-in-place functions and named classes. ^KT-55528 Fixed
This commit is contained in:
Vendored
+2
-2
@@ -134,7 +134,7 @@ class AnonymousInitializers(var a: String, val b: String) {
|
||||
get() = 20
|
||||
|
||||
init {
|
||||
i = 13
|
||||
<!VAL_REASSIGNMENT!>i<!> = 13
|
||||
<!VAL_REASSIGNMENT!>j<!> = 34
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ class AnonymousInitializers(var a: String, val b: String) {
|
||||
val n: Int
|
||||
|
||||
init {
|
||||
while (n == 0) {
|
||||
while (<!UNINITIALIZED_VARIABLE!>n<!> == 0) {
|
||||
}
|
||||
n = 10
|
||||
while (n == 0) {
|
||||
|
||||
Reference in New Issue
Block a user