Generate do-while condition within loop body scope
This commit is contained in:
@@ -1,23 +1,35 @@
|
||||
fun test1(c: Boolean?) {
|
||||
L@ while (true) {
|
||||
while (c ?: break)
|
||||
L2@while (c ?: break)
|
||||
}
|
||||
}
|
||||
|
||||
fun test2(c: Boolean?) {
|
||||
L@ while (true) {
|
||||
while (c ?: continue)
|
||||
L2@while (c ?: continue)
|
||||
}
|
||||
}
|
||||
|
||||
fun test3(ss: List<String>?) {
|
||||
L@ while (true) {
|
||||
for (s in ss ?: continue)
|
||||
L2@for (s in ss ?: continue)
|
||||
}
|
||||
}
|
||||
|
||||
fun test4(ss: List<String>?) {
|
||||
L@ while (true) {
|
||||
for (s in ss ?: break)
|
||||
L2@for (s in ss ?: break)
|
||||
}
|
||||
}
|
||||
|
||||
fun test5() {
|
||||
var i = 0
|
||||
Outer@while (true) {
|
||||
++i
|
||||
var j = 0
|
||||
Inner@do {
|
||||
++j
|
||||
} while (if (j >= 3) false else break) // break@Inner
|
||||
if (i == 3) break
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user