FIR2IR: wrap do-while loop in IrBlock
"so that variables declared in loop body are not visible outside of the
loop" (from commit d096f1d)
This commit is contained in:
committed by
TeamCityServer
parent
08670114c8
commit
7898d167f3
+19
-11
@@ -12,18 +12,24 @@ fun test() {
|
||||
x = <unary>.inc()
|
||||
<unary>
|
||||
}
|
||||
do// COMPOSITE {
|
||||
// } while (less(arg0 = x, arg1 = 0))
|
||||
do{ // BLOCK
|
||||
{ // BLOCK
|
||||
do// COMPOSITE {
|
||||
// } while (less(arg0 = x, arg1 = 0))
|
||||
}
|
||||
{ // BLOCK
|
||||
do{ // BLOCK
|
||||
val <unary>: Int = x
|
||||
x = <unary>.inc()
|
||||
<unary>
|
||||
} while (less(arg0 = x, arg1 = 15))
|
||||
}
|
||||
{ // BLOCK
|
||||
do// COMPOSITE {
|
||||
val <unary>: Int = x
|
||||
x = <unary>.inc()
|
||||
<unary>
|
||||
} while (less(arg0 = x, arg1 = 15))
|
||||
do// COMPOSITE {
|
||||
val <unary>: Int = x
|
||||
x = <unary>.inc()
|
||||
<unary>
|
||||
// } while (less(arg0 = x, arg1 = 20))
|
||||
// } while (less(arg0 = x, arg1 = 20))
|
||||
}
|
||||
}
|
||||
|
||||
fun testSmartcastInCondition() {
|
||||
@@ -32,8 +38,10 @@ fun testSmartcastInCondition() {
|
||||
a is Boolean -> { // BLOCK
|
||||
while (a /*as Boolean */) { // BLOCK
|
||||
}
|
||||
do// COMPOSITE {
|
||||
// } while (a /*as Boolean */)
|
||||
{ // BLOCK
|
||||
do// COMPOSITE {
|
||||
// } while (a /*as Boolean */)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user