about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-mapAttrs-function-strictness.nix
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2024-03-15T13·36+0100
committerclbot <clbot@tvl.fyi>2024-03-19T06·20+0000
commitd1b7e0872608b2d78ddcb2ee473ec9bdbf9695a8 (patch)
treeef078e753eb30db88c4171296329de928a801610 /tvix/eval/src/tests/tvix_tests/eval-okay-builtins-mapAttrs-function-strictness.nix
parent3633d846f88d8306dabd5e820d0f3cd999404050 (diff)
fix(tvix/eval): don't force lambda arg in map, mapAttrs & genList r/7735
It is pretty pointless to force the function argument if we are going to
use a suspended call later since forcing the function may fail in ways
that are not covered by Catchables (non-recoverable errors, infinite
recursions). From this, it kind of seems as if using #[catch] is never
correct and should be replaced by #[lazy]. Also we should probably try
to come up with more test cases for stuff where laziness gets us out of
the jam as an equivalent to the catchable tests for nonrecoverable
errors.

Fixes b/386.

Change-Id: Ia926df4ac1b440ec430403ab7b40924a0c97221b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11153
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Autosubmit: sterni <sternenseemann@systemli.org>
Diffstat (limited to '')
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-builtins-mapAttrs-function-strictness.nix8
1 files changed, 8 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-mapAttrs-function-strictness.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-mapAttrs-function-strictness.nix
new file mode 100644
index 0000000000..2946d6de17
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-mapAttrs-function-strictness.nix
@@ -0,0 +1,8 @@
+let
+  self =
+    let
+      s = builtins.mapAttrs self.f { a = 1; b = 2; };
+    in
+    { f = _: x: x; } // s;
+in
+self