From fd14eefed6cdf0d0f5b14b516515660ced69181b Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 6 Sep 2022 20:43:49 +0300 Subject: fix(tvix/eval): correctly account for slots during list construction Similarly to attribute sets, list elements can be arbitrary expressions and their (temporary) stack slots during construction must be accounted for by the compiler. Change-Id: I3b6f7927860627fd867c64d0cab9104fd636d4f5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6470 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/tests/tvix_tests/eval-okay-with-in-list.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-with-in-list.nix | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-with-in-list.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-with-in-list.nix (limited to 'tvix/eval/src/tests/tvix_tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-with-in-list.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-with-in-list.exp new file mode 100644 index 000000000000..5776134d0e41 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-with-in-list.exp @@ -0,0 +1 @@ +[ 1 2 3 ] diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-with-in-list.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-with-in-list.nix new file mode 100644 index 000000000000..bb62fdf31cd7 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-with-in-list.nix @@ -0,0 +1,13 @@ +# This code causes a situation where a list element causes an +# additional phantom value to temporarily be placed on the locals +# stack, which must be correctly accounted for by the compiler. + +let + set = { + value = 2; + }; +in [ + 1 + (with set; value) + 3 +] -- cgit 1.4.1