about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRyan Lahfa <tvl@lahfa.xyz>2024-01-10T22·26+0100
committerraitobezarius <tvl@lahfa.xyz>2024-01-17T17·39+0000
commite5e33611d75b333492221e407e485a7dbfb438aa (patch)
tree0f21f3968b6eaec3279887bd885187ca01395d58
parentf71bb351d29f58935e6002615cd94d6e6259bf26 (diff)
fix(tvix/eval): catchable-aware `elem` r/7405
`elem` did not catch the list being a catchable.
This surfaced during Nixpkgs evaluation.

Change-Id: Icf19b94e914e35a435c4412d769ee63ba59ab7b0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10599
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
-rw-r--r--tvix/eval/src/builtins/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index 2070f6591e47..eb24c0559f30 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -397,6 +397,10 @@ mod pure_builtins {
 
     #[builtin("elem")]
     async fn builtin_elem(co: GenCo, x: Value, xs: Value) -> Result<Value, ErrorKind> {
+        if xs.is_catchable() {
+            return Ok(xs);
+        }
+
         for val in xs.to_list()? {
             match generators::check_equality(&co, x.clone(), val, PointerEquality::AllowAll).await?
             {