KT-14581 Make FixStackAnalyzer tolerant to uninitialized values

This commit is contained in:
Dmitry Petrov
2016-11-10 18:09:32 +03:00
parent 71ef8c4f89
commit b429f7bc86
9 changed files with 104 additions and 3 deletions
@@ -0,0 +1,10 @@
fun box(): String {
val ok: String? = "OK"
var res = ""
do {
res += ok ?: break
} while (false)
return res
}
@@ -0,0 +1,6 @@
fun box(): String {
var i = 0
do continue while (i++ < 3)
return "OK"
}
@@ -0,0 +1,11 @@
fun foo(x: String): String {
var y: String
do {
y = x
} while (y != x.bar(x))
return y
}
inline fun String.bar(other: String) = this
fun box(): String = foo("OK")