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
@@ -7,7 +7,7 @@ class Test {
|
||||
val t = object {
|
||||
fun some() {
|
||||
// See KT-13597
|
||||
a = "12"
|
||||
<!VAL_REASSIGNMENT!>a<!> = "12"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ class Test2 {
|
||||
init {
|
||||
val t = object {
|
||||
fun some() {
|
||||
a = "12"
|
||||
<!VAL_REASSIGNMENT!>a<!> = "12"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class Test4 {
|
||||
init {
|
||||
exec {
|
||||
// See KT-14381
|
||||
a = "12"
|
||||
<!CAPTURED_MEMBER_VAL_INITIALIZATION!>a<!> = "12"
|
||||
}
|
||||
a = "34"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user