feat(nix/eval): Implement builtins.functionArgs

Now that we're tracking formals on Lambda this ends up being quite easy;
we just pull them off of the Lambda for the argument closure and use
them to construct the result attribute set.

Change-Id: I811cb61ec34c6bef123a4043000b18c0e4ea0125
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7003
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
This commit is contained in:
Griffin Smith 2022-10-13 00:12:25 -04:00 committed by tazjin
parent 2a3d498104
commit 0063e7e913
4 changed files with 100 additions and 0 deletions

View file

@ -127,6 +127,10 @@ mod arbitrary {
}
impl NixAttrs {
pub fn empty() -> Self {
Self(AttrsRep::Empty)
}
/// Return an attribute set containing the merge of the two
/// provided sets. Keys from the `other` set have precedence.
pub fn update(self, other: Self) -> Self {