func inner() {
x = 8000
}
func outer() > Int {
x = 3
inner()
return x
}
print(outer) // prints 8000 instead of 3
Reason
So when we call a function we stack a new environment ontop the current one.
This is wrong we should stack the new environment ontop of the global one.
Example
Reason
So when we call a function we stack a new environment ontop the current one. This is wrong we should stack the new environment ontop of the global one.