runtime mutable global state
This commit is contained in:
@@ -31,12 +31,12 @@ main func() i32 {
|
||||
}
|
||||
}
|
||||
|
||||
# The body-local k shadows only inside the body. The update still targets
|
||||
# Body-local storage stays scoped to the body. The update still targets
|
||||
# the mutable k declared before the loop.
|
||||
k u32 = 0
|
||||
while k < 4 : k = k + 1 {
|
||||
k u32 = 100
|
||||
if k == 100 {
|
||||
body_k u32 = 100
|
||||
if body_k == 100 {
|
||||
total = total + 2
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user