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:
parent
2883b2d4bd
commit
9cb3cd10f5
3 changed files with 8 additions and 0 deletions
|
@ -576,6 +576,12 @@ mod pure_builtins {
|
||||||
|
|
||||||
#[builtin("intersectAttrs")]
|
#[builtin("intersectAttrs")]
|
||||||
async fn builtin_intersect_attrs(co: GenCo, x: Value, y: Value) -> Result<Value, ErrorKind> {
|
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()?;
|
let left_set = x.to_attrs()?;
|
||||||
if left_set.is_empty() {
|
if left_set.is_empty() {
|
||||||
return Ok(Value::attrs(NixAttrs::empty()));
|
return Ok(Value::attrs(NixAttrs::empty()));
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
false
|
|
@ -0,0 +1 @@
|
||||||
|
(builtins.tryEval (builtins.intersectAttrs (throw "fred") {})).success
|
Loading…
Add table
Reference in a new issue