Files
kotlin-fork/compiler/testData/diagnostics/tests/controlFlowAnalysis/repeatUnitializedErrorOnlyForLocalVars.fir.kt
T
Brian Norman 4b6c767704 [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.
2023-09-19 13:42:54 +00:00

16 lines
330 B
Kotlin
Vendored

package aa
val a : Int = <!UNINITIALIZED_VARIABLE!>b<!>
val b : Int = a + <!UNINITIALIZED_VARIABLE!>b<!>
class C {
val a : Int = <!UNINITIALIZED_VARIABLE!>b<!>
val b : Int = a + <!UNINITIALIZED_VARIABLE!>b<!>
}
fun foo() {
val a : Int
<!UNINITIALIZED_VARIABLE!>a<!> + 1
<!UNINITIALIZED_VARIABLE!>a<!> + 1
}