about summary refs log tree commit diff
path: root/tvix/eval
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval')
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-inequality.exp (renamed from tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-catchable-in-inequality.exp)0
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-inequality.nix (renamed from tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-catchable-in-inequality.nix)0
-rw-r--r--tvix/eval/src/vm/mod.rs9
3 files changed, 7 insertions, 2 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-catchable-in-inequality.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-inequality.exp
index c508d5366f70..c508d5366f70 100644
--- a/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-catchable-in-inequality.exp
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-inequality.exp
diff --git a/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-catchable-in-inequality.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-inequality.nix
index 93836bd8feeb..93836bd8feeb 100644
--- a/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-catchable-in-inequality.nix
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-catchable-in-inequality.nix
diff --git a/tvix/eval/src/vm/mod.rs b/tvix/eval/src/vm/mod.rs
index 312d1b893520..3d3b47be23e3 100644
--- a/tvix/eval/src/vm/mod.rs
+++ b/tvix/eval/src/vm/mod.rs
@@ -675,8 +675,13 @@ impl<'o> VM<'o> {
                 }
 
                 OpCode::OpInvert => {
-                    let v = self.stack_pop().as_bool().with_span(&frame, self)?;
-                    self.stack.push(Value::Bool(!v));
+                    let v = self.stack_pop();
+                    if v.is_catchable() {
+                        self.stack.push(v);
+                    } else {
+                        let v = v.as_bool().with_span(&frame, self)?;
+                        self.stack.push(Value::Bool(!v));
+                    }
                 }
 
                 OpCode::OpList(Count(count)) => {