Control-flow analysis: do-while scope is ended after condition but before jump #KT-15334 Fixed
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// See KT-15334: incorrect reassignment in do...while
|
||||
|
||||
fun test() {
|
||||
do {
|
||||
val s: String
|
||||
s = ""
|
||||
} while (s == "")
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
while (true) {
|
||||
val s: String
|
||||
s = ""
|
||||
if (s != "") break
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user