From aadf71a6ed18855a1fa8b4d5a76508300f463966 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 5 Jan 2023 16:02:46 +0300 Subject: feat(tvix/eval): warn on empty let-bindings Change-Id: Ib6ef7ce514abbd3e372dfe9df7137aa36dbda9d4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7770 Reviewed-by: raitobezarius Reviewed-by: flokli Tested-by: BuildkiteCI --- tvix/eval/src/compiler/bindings.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tvix/eval/src/compiler') diff --git a/tvix/eval/src/compiler/bindings.rs b/tvix/eval/src/compiler/bindings.rs index 83667c129be0..682cf134ce1a 100644 --- a/tvix/eval/src/compiler/bindings.rs +++ b/tvix/eval/src/compiler/bindings.rs @@ -647,6 +647,9 @@ impl Compiler<'_> { self.emit_constant(Value::Attrs(Box::new(NixAttrs::empty())), node); return; } + + self.emit_warning(node, WarningKind::EmptyLet); + return; } // Actually bind values and ensure they are on the stack. -- cgit 1.4.1