More precise value reassignment analysis. #KT-7418 Fixed. #KT-6902 Fixed.

Variable can now be "exactly initialized", "may be initialized" and "not initialized".
A set of relevant tests. Some fixed tests.
This commit is contained in:
Mikhail Glukhikh
2015-09-01 19:16:27 +03:00
parent c59b118b09
commit 285d5d06c7
26 changed files with 269 additions and 53 deletions
@@ -0,0 +1,9 @@
// !DIAGNOSTICS: -UNUSED_VALUE
fun foo(k: Int): Int {
val i: Int
for (j in 1..k) {
<!VAL_REASSIGNMENT!>i<!> = j
}
return <!UNINITIALIZED_VARIABLE!>i<!>
}