Fix scoping and break statements.
Variables declared in the loop were not properly disposed of when you broke out of the loop.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
for (i in 0..10) {
|
||||
IO.print(i)
|
||||
|
||||
{
|
||||
var a = "a"
|
||||
{
|
||||
var b = "b"
|
||||
{
|
||||
var c = "c"
|
||||
if (i > 1) break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// expect: 0
|
||||
// expect: 1
|
||||
// expect: 2
|
||||
Reference in New Issue
Block a user