fix(tvix/eval): propagate catchables through builtins.intersectAttrs

Change-Id: I4ada8cf10611e98519cb1b1da11bfd06815f2932
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10358
Autosubmit: Adam Joseph <adam@westernsemico.com>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
Adam Joseph 2023-12-13 05:02:01 -08:00 committed by tazjin
parent 2883b2d4bd
commit 9cb3cd10f5
3 changed files with 8 additions and 0 deletions

View file

@ -576,6 +576,12 @@ mod pure_builtins {
#[builtin("intersectAttrs")]
async fn builtin_intersect_attrs(co: GenCo, x: Value, y: Value) -> Result<Value, ErrorKind> {
if x.is_catchable() {
return Ok(x);
}
if y.is_catchable() {
return Ok(y);
}
let left_set = x.to_attrs()?;
if left_set.is_empty() {
return Ok(Value::attrs(NixAttrs::empty()));

View file

@ -0,0 +1 @@
(builtins.tryEval (builtins.intersectAttrs (throw "fred") {})).success