Fixed variable lifetime in loops

This commit is contained in:
2024-07-16 20:22:28 +02:00
parent 1825a72f8c
commit f9d72fe490
11 changed files with 90 additions and 18 deletions

View File

@ -0,0 +1,17 @@
main() {
n := 10
x := 1
loop {
if n == 0 {
return
}
f(x)
n -= 1
}
}
f(x) {
return x
}