From 10c6cb7251480ca12e67b3d237740e6dcb93f87e Mon Sep 17 00:00:00 2001 From: sterni Date: Fri, 2 Jun 2023 22:38:00 +0200 Subject: fix(tvix/eval): type check function argument with set pattern C++ Nix forces and typechecks the passed argument even if it is not necessary in order to compute the return value of the function. I discovered this when I thought our formals miscompilation might be that we are too strict, but doesn't look like it in this case. Change-Id: Ifb3c92592293052c489d1e3ae8c7c54e4b6b4dc6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8701 Tested-by: BuildkiteCI Autosubmit: sterni Reviewed-by: tazjin --- tvix/eval/src/tests/tvix_tests/eval-fail-function-formals-typecheck.nix | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-fail-function-formals-typecheck.nix (limited to 'tvix/eval/src/tests/tvix_tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-fail-function-formals-typecheck.nix b/tvix/eval/src/tests/tvix_tests/eval-fail-function-formals-typecheck.nix new file mode 100644 index 0000000000..0108f958bf --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-fail-function-formals-typecheck.nix @@ -0,0 +1,2 @@ +# A function with formal set arguments forces its argument set and verifies its type. +({ ... }@args: 42) [ ] -- cgit 1.4.1