fix(tvix/eval): preserve catchables in nix_cmp_ordering(), fix b/338
This commit fixes b/338 by properly propagating catchables through comparison operations. Change-Id: I6b0283a40f228ecf9a6398d24c060bdacb1077cf Reviewed-on: https://cl.tvl.fyi/c/depot/+/10221 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Autosubmit: Adam Joseph <adam@westernsemico.com>
This commit is contained in:
parent
ae28dc3ca6
commit
ad566999ca
5 changed files with 15 additions and 9 deletions
|
|
@ -611,10 +611,11 @@ mod pure_builtins {
|
|||
#[builtin("lessThan")]
|
||||
async fn builtin_less_than(co: GenCo, x: Value, y: Value) -> Result<Value, ErrorKind> {
|
||||
let span = generators::request_span(&co).await;
|
||||
Ok(Value::Bool(matches!(
|
||||
x.nix_cmp_ordering(y, co, span).await?,
|
||||
Ordering::Less
|
||||
)))
|
||||
match x.nix_cmp_ordering(y, co, span).await? {
|
||||
Err(cek) => Ok(Value::Catchable(cek)),
|
||||
Ok(Ordering::Less) => Ok(Value::Bool(true)),
|
||||
Ok(_) => Ok(Value::Bool(false)),
|
||||
}
|
||||
}
|
||||
|
||||
#[builtin("listToAttrs")]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue