aboutsummaryrefslogtreecommitdiff
path: root/tests/lang/eval-okay-foldlStrict-lazy-elements.nix
diff options
context:
space:
mode:
authorValentin Gagarin <valentin.gagarin@tweag.io>2023-02-19 23:54:14 +0100
committerGitHub <noreply@github.com>2023-02-19 23:54:14 +0100
commitdda83a59c1cdaaceedc2f2f64606a51dfacdf0bc (patch)
treef6515dbb0da0e4f98d0754ef8e820f49159fa466 /tests/lang/eval-okay-foldlStrict-lazy-elements.nix
parenta88ae62bc0e404b7f87876bfd0a74afbac4d517d (diff)
parentd0f2da214badd4cded6fb00e97af4588da49c0d0 (diff)
Merge pull request #7158 from sternenseemann/foldl-strict-accumulation-value
Diffstat (limited to 'tests/lang/eval-okay-foldlStrict-lazy-elements.nix')
-rw-r--r--tests/lang/eval-okay-foldlStrict-lazy-elements.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/lang/eval-okay-foldlStrict-lazy-elements.nix b/tests/lang/eval-okay-foldlStrict-lazy-elements.nix
new file mode 100644
index 000000000..c666e07f3
--- /dev/null
+++ b/tests/lang/eval-okay-foldlStrict-lazy-elements.nix
@@ -0,0 +1,9 @@
+# Tests that the rhs argument of op is not forced unconditionally
+let
+ lst = builtins.foldl'
+ (acc: x: acc ++ [ x ])
+ [ ]
+ [ 42 (throw "this shouldn't be evaluated") ];
+in
+
+builtins.head lst