aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler.rs
diff options
context:
space:
mode:
authorEdvard Thörnros <edvard.thornros@gmail.com>2021-03-07 15:21:28 +0100
committerEdvard Thörnros <edvard.thornros@gmail.com>2021-03-07 15:27:32 +0100
commitf5390849792718cd7b5c709241225b59ea86ae03 (patch)
tree67101161b8d33b458d9d4e787cd65c43778ce87c /src/compiler.rs
parent7d954e6f5b54bd1dda24c8aa5e968a6185d8017d (diff)
downloadsylt-f5390849792718cd7b5c709241225b59ea86ae03.tar.gz
constants in outer scope
Diffstat (limited to 'src/compiler.rs')
-rw-r--r--src/compiler.rs3
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