about summary refs log tree commit diff
path: root/users/fogti
diff options
context:
space:
mode:
authorAspen Smith <root@gws.fyi>2024-02-08T21·52-0500
committeraspen <root@gws.fyi>2024-02-08T22·50+0000
commit8446cd1c8b5747738264dea9acd2be76e2db054e (patch)
tree69d5298c4dad04da84ce02babc8a61f5656e390c /users/fogti
parentddb7bc8d18bd11deb87a70ec300a281aaf34c2c7 (diff)
fix(tvix/eval): Inline List.sort_by, and propagate errors r/7488
In order to correctly propagate errors in the comparator passed to
builtins.sort, we need to do all the sorting in a context where we can
short-circuit return `Value`s (because catchables are Values on the `Ok`
side of the Result , not `Err`s). Unfortunately this means we have
to *inline* the List `sort_by` implementation into the builtin_sort
function - fortunately this is the only place that was called so this is
relatively low cost. This does that, and adds the requisite `try_value!`
invocation to allow us to propagate comparator errors here.

As before, this doesn't include tests, primarily since those are coming
in the next commit.

Change-Id: I8453c3aa2cd82299eae89828e2a2bb118da4cd48
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10754
Tested-by: BuildkiteCI
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Diffstat (limited to 'users/fogti')
0 files changed, 0 insertions, 0 deletions