From abdfa7459eb60f2b92064bdff12e33d04491e1cd Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 3 Sep 2022 16:18:06 +0300 Subject: feat(tvix/eval): thunk binary operations and select expressions With this, most cases of `fix` in attribute sets will work correctly. A simple test exercising both has been added. Change-Id: I70fd431177bb6e48ecb33a87518b050c4c3d1c09 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6437 Reviewed-by: sterni Tested-by: BuildkiteCI --- tvix/eval/src/tests/tvix_tests/eval-okay-fix.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-fix.nix | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-fix.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-fix.nix (limited to 'tvix/eval/src/tests/tvix_tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-fix.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-fix.exp new file mode 100644 index 000000000000..c1581543511f --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-fix.exp @@ -0,0 +1 @@ +{ a = 1; b = 21; c = 42; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-fix.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-fix.nix new file mode 100644 index 000000000000..27d2fae1042e --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-fix.nix @@ -0,0 +1,7 @@ +let + fix = f: let x = f x; in x; +in fix(self: { + a = 1; + b = self.a + 20; + c = self.b * 2; +}) -- cgit 1.4.1