From 1cb19314069a74d526165a53d56bac5dfb3f9c9c Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 13 Aug 2022 21:52:44 +0300 Subject: 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 --- tvix/eval/src/compiler.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tvix/eval/src/compiler.rs') diff --git a/tvix/eval/src/compiler.rs b/tvix/eval/src/compiler.rs index e2d194e8ddbb..75ea99ea787c 100644 --- a/tvix/eval/src/compiler.rs +++ b/tvix/eval/src/compiler.rs @@ -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"), } } -- cgit 1.4.1