about summary refs log tree commit diff
path: root/tvix/eval/src/compiler
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2023-01-05T13·02+0300
committertazjin <tazjin@tvl.su>2023-01-06T12·23+0000
commitaadf71a6ed18855a1fa8b4d5a76508300f463966 (patch)
treeb034bd24e0779221cbb7fb3b7a2d5b444f121474 /tvix/eval/src/compiler
parent61b8a9b2ba278f697735a2c3ff77fff091c8f464 (diff)
feat(tvix/eval): warn on empty let-bindings r/5606
Change-Id: Ib6ef7ce514abbd3e372dfe9df7137aa36dbda9d4
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7770
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/compiler')
-rw-r--r--tvix/eval/src/compiler/bindings.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/tvix/eval/src/compiler/bindings.rs b/tvix/eval/src/compiler/bindings.rs
index 83667c129b..682cf134ce 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.