about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-internal-formals-deferred.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-01-29T15·49+0300
committertazjin <tazjin@tvl.su>2023-01-31T10·25+0000
commit7702941dd9f561cb1f90ada28aa7401ea54a86db (patch)
treecd186b769def6256b53e82a8a3ee1023a922ccf4 /tvix/eval/src/tests/tvix_tests/eval-okay-internal-formals-deferred.nix
parent4b3ccd205ac6c95dc5b99391b6e9026db6700a9c (diff)
test(tvix/eval): add tests for internal formals dependencies r/5784
Formals can depend on each other when using another formal as a
default value.

This test ensures that the compiler's declaration and initialisation
order of formals is consistent with what actually happens in the VM.

Change-Id: Ibdabe262554e8066d67fac1ebc3b5a48ef626e18
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7948
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/eval/src/tests/tvix_tests/eval-okay-internal-formals-deferred.nix')
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-internal-formals-deferred.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-internal-formals-deferred.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-internal-formals-deferred.nix
new file mode 100644
index 000000000000..5c6702120fc4
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-internal-formals-deferred.nix
@@ -0,0 +1,3 @@
+# Tests formals which have internal default values that must be deferred.
+
+({ optional ? defaultValue, defaultValue }: optional) { defaultValue = 42; }