diff options
author | Ryan Lahfa <tvl@lahfa.xyz> | 2024-01-10T22·26+0100 |
---|---|---|
committer | raitobezarius <tvl@lahfa.xyz> | 2024-01-17T17·39+0000 |
commit | e5e33611d75b333492221e407e485a7dbfb438aa (patch) | |
tree | 0f21f3968b6eaec3279887bd885187ca01395d58 /tvix/eval | |
parent | f71bb351d29f58935e6002615cd94d6e6259bf26 (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
Diffstat (limited to 'tvix/eval')
-rw-r--r-- | tvix/eval/src/builtins/mod.rs | 4 |
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? { |