fix(tvix/eval): Propagate catchables in NixAttrs::construct

Correctly propagate the case where the *key* of an attrset is a
Value::Catchable (eg { "${builtins.throw "c"}" = "b"; }) in
`NixAttrs::construct`, by converting the return type to
`Result<Result<Self, CatchableErrorKind>, ErrorKind>` (ugh!!) and
correctly handling that everywhere (including an `expect` in the
Deserialize impl for NixAttrs, since afaict this is impossible to hit
when deserializing from stuff like JSON).

Change-Id: Ic4bc611fbfdab27c0bd8a40759689a87c4004a17
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10786
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
This commit is contained in:
Aspen Smith 2024-02-09 12:59:04 -05:00 committed by aspen
parent 7a589b3ec6
commit 3fb0697a71
5 changed files with 31 additions and 13 deletions

View file

@ -0,0 +1 @@
false

View file

@ -0,0 +1 @@
(builtins.tryEval { "${builtins.throw "a"}" = "b"; }).success