about summary refs log tree commit diff
path: root/tvix
diff options
context:
space:
mode:
Diffstat (limited to 'tvix')
-rw-r--r--tvix/eval/src/builtins/mod.rs7
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-builtins-filter-catchable.exp1
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-builtins-filter-catchable.nix1
3 files changed, 7 insertions, 2 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index 295d94b73523..4844ae8f1b53 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -316,8 +316,11 @@ mod pure_builtins {
 
         for value in list {
             let result = generators::request_call_with(&co, pred.clone(), [value.clone()]).await;
-
-            if generators::request_force(&co, result).await.as_bool()? {
+            let verdict = generators::request_force(&co, result).await;
+            if verdict.is_catchable() {
+                return Ok(verdict);
+            }
+            if verdict.as_bool()? {
                 out.push_back(value);
             }
         }
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-filter-catchable.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-filter-catchable.exp
new file mode 100644
index 000000000000..c508d5366f70
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-filter-catchable.exp
@@ -0,0 +1 @@
+false
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-filter-catchable.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-filter-catchable.nix
new file mode 100644
index 000000000000..98d90b01bb21
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-filter-catchable.nix
@@ -0,0 +1 @@
+(builtins.tryEval (builtins.filter (_: throw "fred") [ 3 ])).success