feat(tvix/eval): warn about empty inherits

Change-Id: I82bec6fe2210bcb88c46fd2fdf3e26bd613d1c1f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7768
Reviewed-by: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2023-01-05 15:32:14 +03:00 committed by tazjin
parent e8dcdceb34
commit 4e98730f38
2 changed files with 11 additions and 0 deletions

View file

@ -321,6 +321,11 @@ impl Compiler<'_> {
let mut inherit_froms: Vec<(ast::Expr, SmolStr, Span)> = vec![];
for inherit in node.inherits() {
if inherit.attrs().peekable().peek().is_none() {
self.emit_warning(&inherit, WarningKind::EmptyInherit);
continue;
}
match inherit.from() {
// Within a `let` binding, inheriting from the outer scope is a
// no-op *if* there are no dynamic bindings.