[FIR] Report UNINITIALIZED_VARIABLE for top-level properties

When checking top-level properties, check with initialization enabled.
This makes sure the same errors are reported for member and top-level
properties.
This commit is contained in:
Brian Norman
2023-08-31 11:30:08 -05:00
committed by Space Team
parent 1a35d01fe1
commit 4b6c767704
19 changed files with 300 additions and 97 deletions
@@ -255,7 +255,7 @@ class Outer() {
}
class ForwardAccessToBackingField() { //kt-147
val a = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM, UNINITIALIZED_VARIABLE!>a<!> // error
val a = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>a<!> // error
val b = <!UNINITIALIZED_VARIABLE!>c<!> // error
val c = 1
}
@@ -1,4 +0,0 @@
package a
val a : Int = b
val b : Int = a
@@ -1,4 +1,5 @@
// FIR_IDENTICAL
package a
val a : Int = <!UNINITIALIZED_VARIABLE!>b<!>
val b : Int = a
val b : Int = a
@@ -1,7 +1,7 @@
package aa
val a : Int = b
val b : Int = a + b
val a : Int = <!UNINITIALIZED_VARIABLE!>b<!>
val b : Int = a + <!UNINITIALIZED_VARIABLE!>b<!>
class C {
val a : Int = <!UNINITIALIZED_VARIABLE!>b<!>