fix(tvix/eval): skip inherit with no explicit parent in let

Using `inherit` in a let-binding can not possibly have an effect, as
the given identifier is already bound exactly the same way in the
current scope.

This introduces a subtle bug that is fixed later on, as there
actually *is* a (single) condition where these inherits are
meaningful.

Change-Id: I8b24f0edcfe80db8153bb7e86cf478d36957d6f8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6192
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2022-08-13 20:39:25 +03:00 committed by tazjin
parent 36748fe4f6
commit ab12b0abff

View file

@ -676,8 +676,13 @@ impl Compiler {
});
}
for _ in node.inherits() {
todo!("inherit in let not yet implemented")
for inherit in node.inherits() {
match inherit.from() {
// Within a `let` binding, inheriting from the outer
// scope is practically a no-op.
None => continue,
Some(_) => todo!("let inherit from attrs"),
}
}
// Now we can compile each expression, leaving the values on