about summary refs log tree commit diff
path: root/tvix/eval/src/compiler/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/compiler/mod.rs')
-rw-r--r--tvix/eval/src/compiler/mod.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs
index 52b6e8e542ee..4d6728b6d6c3 100644
--- a/tvix/eval/src/compiler/mod.rs
+++ b/tvix/eval/src/compiler/mod.rs
@@ -192,7 +192,10 @@ impl Compiler<'_, '_> {
     fn compile_literal(&mut self, node: ast::Literal) {
         let value = match node.kind() {
             ast::LiteralKind::Float(f) => Value::Float(f.value().unwrap()),
-            ast::LiteralKind::Integer(i) => Value::Integer(i.value().unwrap()),
+            ast::LiteralKind::Integer(i) => match i.value() {
+                Ok(v) => Value::Integer(v),
+                Err(err) => return self.emit_error(&node, err.into()),
+            },
 
             ast::LiteralKind::Uri(u) => {
                 self.emit_warning(&node, WarningKind::DeprecatedLiteralURL);