Fixed variable lifetime in loops
This commit is contained in:
17
tests/programs/loop-lifetime.q
Normal file
17
tests/programs/loop-lifetime.q
Normal file
@ -0,0 +1,17 @@
|
||||
main() {
|
||||
n := 10
|
||||
x := 1
|
||||
|
||||
loop {
|
||||
if n == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
f(x)
|
||||
n -= 1
|
||||
}
|
||||
}
|
||||
|
||||
f(x) {
|
||||
return x
|
||||
}
|
Reference in New Issue
Block a user