KT-14581 Make FixStackAnalyzer tolerant to uninitialized values
This commit is contained in:
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
fun box(): String {
|
||||
val ok: String? = "OK"
|
||||
var res = ""
|
||||
|
||||
do {
|
||||
res += ok ?: break
|
||||
} while (false)
|
||||
|
||||
return res
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
fun box(): String {
|
||||
var i = 0
|
||||
do continue while (i++ < 3)
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+11
@@ -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")
|
||||
Reference in New Issue
Block a user