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:
+3
-3
@@ -19,7 +19,7 @@ fun test2() {
|
||||
}
|
||||
|
||||
fun localFunc() {
|
||||
y = 0
|
||||
<!CAPTURED_VAL_INITIALIZATION!>y<!> = 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,11 +33,11 @@ fun test3() {
|
||||
|
||||
class A {
|
||||
init {
|
||||
x = 0
|
||||
<!CAPTURED_VAL_INITIALIZATION!>x<!> = 0
|
||||
}
|
||||
|
||||
fun localFunc() {
|
||||
y = 0
|
||||
<!CAPTURED_VAL_INITIALIZATION!>y<!> = 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user