fix(tvix/eval): wrap asserts in a thunk
As the new test case demonstrates, asserts need to be evaluated lazily. Change-Id: I808046722c5a504e9497855ca5026d255c7a4c34 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6494 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
parent
f95b23d743
commit
240d90aa8a
3 changed files with 12 additions and 1 deletions
1
tvix/eval/src/tests/tvix_tests/eval-okay-lazy-assert.exp
Normal file
1
tvix/eval/src/tests/tvix_tests/eval-okay-lazy-assert.exp
Normal file
|
|
@ -0,0 +1 @@
|
|||
12
|
||||
8
tvix/eval/src/tests/tvix_tests/eval-okay-lazy-assert.nix
Normal file
8
tvix/eval/src/tests/tvix_tests/eval-okay-lazy-assert.nix
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
assert true;
|
||||
|
||||
let
|
||||
x = assert false; 13;
|
||||
y = 12;
|
||||
in
|
||||
|
||||
{ inherit x y; }.y
|
||||
Loading…
Add table
Add a link
Reference in a new issue