about summary refs log tree commit diff
path: root/tvix/eval/src/builtins
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2023-12-12T11·39-0800
committerclbot <clbot@tvl.fyi>2023-12-12T17·49+0000
commit2565a21aa9e88465c78634c763c9a34a2332f4f6 (patch)
tree05e2423a2a3ebfcb5f3d222055f3599ff904ec64 /tvix/eval/src/builtins
parent331d9ee54ad2b60e20c628359832dd60a1785d6d (diff)
fix(tvix/eval): builtins.length: propagate catchables r/7203
This commit fixes out builtins.length so it propagates catchables
like cppnix does.

Change-Id: I7670bec5eee1d4cd3f67a04c9a6808979fb56a8d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10315
Reviewed-by: tazjin <tazjin@tvl.su>
Autosubmit: Adam Joseph <adam@westernsemico.com>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/builtins')
-rw-r--r--tvix/eval/src/builtins/mod.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index 4844ae8f1b53..c2618a4066f4 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -665,6 +665,9 @@ mod pure_builtins {
 
     #[builtin("length")]
     async fn builtin_length(co: GenCo, list: Value) -> Result<Value, ErrorKind> {
+        if list.is_catchable() {
+            return Ok(list);
+        }
         Ok(Value::Integer(list.to_list()?.len() as i64))
     }