fix(tvix/eval): force argument of builtins.length
Change-Id: Iaf94dfc7cb058f5c1c311066d92e01512e09cf71 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6417 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
This commit is contained in:
parent
0c0ae50f02
commit
b83723a1ed
1 changed files with 4 additions and 1 deletions
|
@ -45,7 +45,10 @@ fn pure_builtins() -> Vec<Builtin> {
|
|||
let a = args.pop().unwrap();
|
||||
arithmetic_op!(a, b, /)
|
||||
}),
|
||||
Builtin::new("length", 1, |args, _| {
|
||||
Builtin::new("length", 1, |args, vm| {
|
||||
if let Value::Thunk(t) = &args[0] {
|
||||
t.force(vm)?;
|
||||
}
|
||||
Ok(Value::Integer(args[0].to_list()?.len() as i64))
|
||||
}),
|
||||
Builtin::new("isAttrs", 1, |args, _| {
|
||||
|
|
Loading…
Add table
Reference in a new issue