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 <grfn@gws.fyi> Tested-by: BuildkiteCI
This commit is contained in:
parent
7db4f8d774
commit
8c1c9aee3c
5 changed files with 39 additions and 12 deletions
|
|
@ -0,0 +1 @@
|
|||
15
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
# the 'from' part of an `inherit` can be any expression.
|
||||
{ inherit ({a = 15;}) a; }.a
|
||||
|
|
@ -0,0 +1 @@
|
|||
{ a = 15; }
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
let a = 15;
|
||||
in { inherit a; }
|
||||
Loading…
Add table
Add a link
Reference in a new issue