feat(tvix/eval): merge attribute sets in bindings
This is a significant step towards correctly implemented nested bindings. All attribute sets defined within the same binding scope will now be merged as in Nix, if they use the same key. Change-Id: I13e056693d5e73192280043c6dd93b47d1306ed6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6800 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
parent
0cee44838c
commit
cece9eae4a
5 changed files with 133 additions and 13 deletions
|
|
@ -0,0 +1 @@
|
|||
{ set = { a = 1; b = 2; }; }
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
set = {
|
||||
a = 1;
|
||||
};
|
||||
|
||||
set = {
|
||||
b = 2;
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
{ set = { a = 21; b = 42; }; }
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
set = rec {
|
||||
a = 21;
|
||||
};
|
||||
|
||||
set = {
|
||||
# Fun fact: This might be the only case in Nix where a lexical
|
||||
# resolution of an identifier can only be resolved by looking at
|
||||
# *siblings* in the AST.
|
||||
b = 2 * a;
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue