Currently, scopes are "leaky", meaning a variable defined inside one block can be used outside of that block.
This will become particularly problematic after we add if statements.
Make it so that variables are checked to see if they follow scope rules. Emit errors if a variable disobeys scope rules.
Ideally we could prepare for adding support to the global scope, or just add it directly. Then, compilation can error early in the case of a misnamed function.
Currently, scopes are "leaky", meaning a variable defined inside one block can be used outside of that block. This will become particularly problematic after we add if statements.
Make it so that variables are checked to see if they follow scope rules. Emit errors if a variable disobeys scope rules.
Ideally we could prepare for adding support to the global scope, or just add it directly. Then, compilation can error early in the case of a misnamed function.