diff options
| author | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-03-07 15:21:28 +0100 |
|---|---|---|
| committer | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-03-07 15:27:32 +0100 |
| commit | f5390849792718cd7b5c709241225b59ea86ae03 (patch) | |
| tree | 67101161b8d33b458d9d4e787cd65c43778ce87c | |
| parent | 7d954e6f5b54bd1dda24c8aa5e968a6185d8017d (diff) | |
| download | sylt-f5390849792718cd7b5c709241225b59ea86ae03.tar.gz | |
constants in outer scope
| -rw-r--r-- | src/compiler.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/compiler.rs b/src/compiler.rs index 9c8f830..116e3d2 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -1184,10 +1184,9 @@ impl Compiler { // Global let var = self.find_variable(name) .expect(&format!("Couldn't find constant '{}' during prepass.", name)); - assert!(var.mutable); + assert!(!var.mutable); self.expression(block); - add_op(self, block, Op::AssignLocal(var.slot)); self.stack_mut()[var.slot].active = true; } else { // Local |
