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
+3
-3
@@ -11,9 +11,9 @@ class Outer {
|
||||
outer.<!VAL_REASSIGNMENT!>outerProp<!> = "3"
|
||||
|
||||
innerProp = "4" + inner.innerProp
|
||||
this@Inner.innerProp = "5"
|
||||
innerProp = "6" // do not repeat the same diagnostic with this receiver
|
||||
this@Inner.innerProp = "7"
|
||||
this@Inner.<!VAL_REASSIGNMENT!>innerProp<!> = "5"
|
||||
<!VAL_REASSIGNMENT!>innerProp<!> = "6" // do not repeat the same diagnostic with this receiver
|
||||
this@Inner.<!VAL_REASSIGNMENT!>innerProp<!> = "7"
|
||||
|
||||
inner.<!VAL_REASSIGNMENT!>innerProp<!> = "8"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user