fix(tvix/eval): thunk all uses of with
With this all other "weird scope" logic starts working for `with` as well. Change-Id: I0ea1d8c5fbd9cec5084bd574224f77b71ff2b487 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6487 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
parent
07ea30370e
commit
627dfabef1
5 changed files with 22 additions and 1 deletions
|
|
@ -0,0 +1 @@
|
|||
42
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
# Tests using `with` on a set that does not yet exist on the stack.
|
||||
|
||||
let
|
||||
result = with set; value;
|
||||
set = {
|
||||
value = 42;
|
||||
};
|
||||
in result
|
||||
1
tvix/eval/src/tests/tvix_tests/eval-okay-manual-rec.exp
Normal file
1
tvix/eval/src/tests/tvix_tests/eval-okay-manual-rec.exp
Normal file
|
|
@ -0,0 +1 @@
|
|||
42
|
||||
9
tvix/eval/src/tests/tvix_tests/eval-okay-manual-rec.nix
Normal file
9
tvix/eval/src/tests/tvix_tests/eval-okay-manual-rec.nix
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Manual desugaring of something similar to `rec`, to test lower level
|
||||
# recursion primitives.
|
||||
|
||||
let
|
||||
set = with set; {
|
||||
a = 21;
|
||||
b = a * 2;
|
||||
};
|
||||
in set.b
|
||||
Loading…
Add table
Add a link
Reference in a new issue