fix(tvix/eval): null in dynamic attribute keys skips the element

This is actually *tested* behaviour in C++ Nix, so we need to
implement it here, too.

Change-Id: Ic4a4659a2f04cdd928cbe78a85dae90401515371
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6199
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2022-08-14 02:24:02 +03:00 committed by tazjin
parent e041851581
commit 2ea71aa4c3

View file

@ -203,6 +203,13 @@ impl NixAttrs {
)?;
}
Value::Null => {
// This is in fact valid, but leads to the value
// being ignored and nothing being set, i.e. `{
// ${null} = 1; } => { }`.
continue;
}
other => {
return Err(Error::InvalidKeyType {
given: other.type_of(),