fix(tvix/eval): don't force lambda arg in map, mapAttrs & genList
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>
This commit is contained in:
parent
3633d846f8
commit
d1b7e08726
8 changed files with 38 additions and 4 deletions
|
|
@ -0,0 +1 @@
|
|||
[ <LAMBDA> 0 1 2 ]
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
let
|
||||
self =
|
||||
let
|
||||
l = builtins.genList (builtins.head self) 3;
|
||||
in
|
||||
[ (x: x) ] ++ l;
|
||||
in
|
||||
self
|
||||
|
|
@ -0,0 +1 @@
|
|||
[ <LAMBDA> 2 "." 18 "https://github.com/NixOS/nix/issues/9779" "-.-" ]
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
let
|
||||
self =
|
||||
let
|
||||
l = builtins.map (builtins.head self) [ 2 "." 18 https://github.com/NixOS/nix/issues/9779 "-.-" ];
|
||||
in
|
||||
[ (x: x) ] ++ l;
|
||||
in
|
||||
self
|
||||
|
|
@ -0,0 +1 @@
|
|||
{ a = 1; b = 2; f = <LAMBDA>; }
|
||||
|
|
@ -0,0 +1,8 @@
|
|||
let
|
||||
self =
|
||||
let
|
||||
s = builtins.mapAttrs self.f { a = 1; b = 2; };
|
||||
in
|
||||
{ f = _: x: x; } // s;
|
||||
in
|
||||
self
|
||||
Loading…
Add table
Add a link
Reference in a new issue