[FIR] Add checker for uninitialized properties

This commit is contained in:
Dmitriy Novozhilov
2020-06-17 11:51:15 +03:00
parent 25621d699b
commit 26458875d5
96 changed files with 1476 additions and 1358 deletions
@@ -0,0 +1,24 @@
// !LANGUAGE: +LateinitLocalVariables
fun test1() {
lateinit var s: String
<!UNINITIALIZED_VARIABLE!>s<!>.length
}
fun test2() {
lateinit var s: String
run {
s = ""
}
s.length
}
fun almostAlwaysTrue(): Boolean = true
fun test3() {
lateinit var s: String
if (almostAlwaysTrue()) {
s = ""
}
<!UNINITIALIZED_VARIABLE!>s<!>.length
}
@@ -1,4 +1,3 @@
// FIR_IDENTICAL
// !LANGUAGE: +LateinitLocalVariables
fun test1() {