From 8c1c9aee3cab52befe55d6f41e1c9acaef1b1843 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 14 Aug 2022 20:12:20 +0300 Subject: feat(tvix/eval): implement `inherit` in attribute set literals Straightforward implementation, evaluating the elements of an inherit and preparing the stack so that `OpAttrs` sees all relevant values when constructing the attribute set itself. The emitted instructions for inheriting a lot of values from the same attribute set are inefficient, but it's too early to say whether this actually matters. Change-Id: Icb55a20936d4ef77173f34433811c5fa5d2c9ecc Reviewed-on: https://cl.tvl.fyi/c/depot/+/6214 Reviewed-by: grfn Tested-by: BuildkiteCI --- tvix/eval/src/tests/tvix_tests/eval-okay-attrs-inherit-literal.nix | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-attrs-inherit-literal.nix (limited to 'tvix/eval/src/tests/tvix_tests/eval-okay-attrs-inherit-literal.nix') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-attrs-inherit-literal.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-attrs-inherit-literal.nix new file mode 100644 index 0000000000..587aec8933 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-attrs-inherit-literal.nix @@ -0,0 +1,2 @@ +# the 'from' part of an `inherit` can be any expression. +{ inherit ({a = 15;}) a; }.a -- cgit 1.4.1