snix/tvix/eval/src/tests/tvix_tests/eval-okay-deferred-unary-formals.nix
Vincent Ambo eef48b8f1f fix(tvix/eval): correctly thunk deferred formals access
Formals can be initialised with deferred default values (see the test
cases), in which case they need an extra thunk to have something that
can be finalised appropriately when the setup is done.

Fixes: b/255
Change-Id: I380e3770be68eaa83ace96d450c7cead32dacc9f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/8196
Tested-by: BuildkiteCI
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2023-03-13 20:30:59 +00:00

6 lines
174 B
Nix

# Application of unary operators on deferred formals arguments (via
# defaulting), see also b/255.
[
(({ b ? !a, a }: b) { a = true; })
(({ b ? -a, a }: b) { a = 2; })
]