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:
parent
ab12b0abff
commit
1cb1931406
2 changed files with 9 additions and 1 deletions
|
@ -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"),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#[derive(Debug)]
|
||||
pub enum WarningKind {
|
||||
DeprecatedLiteralURL,
|
||||
UselessInherit,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
Loading…
Reference in a new issue