feat(tvix/eval): emit warnings on useless inherit

Change-Id: Ifb9993cf8b85393eb43e1b204c7ab2f889b7113b
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6194
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
Vincent Ambo 2022-08-13 21:52:44 +03:00 committed by tazjin
parent ab12b0abff
commit 1cb1931406
2 changed files with 9 additions and 1 deletions

View file

@ -680,7 +680,14 @@ impl Compiler {
match inherit.from() {
// Within a `let` binding, inheriting from the outer
// scope is practically a no-op.
None => continue,
None => {
self.warnings.push(EvalWarning {
node: inherit.node().clone(),
kind: WarningKind::UselessInherit,
});
continue;
}
Some(_) => todo!("let inherit from attrs"),
}
}

View file

@ -4,6 +4,7 @@
#[derive(Debug)]
pub enum WarningKind {
DeprecatedLiteralURL,
UselessInherit,
}
#[derive(Debug)]