about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tvix/eval/src/compiler.rs1
-rw-r--r--tvix/eval/src/warnings.rs1
2 files changed, 2 insertions, 0 deletions
diff --git a/tvix/eval/src/compiler.rs b/tvix/eval/src/compiler.rs
index cb97b61c98..a2ab6273c1 100644
--- a/tvix/eval/src/compiler.rs
+++ b/tvix/eval/src/compiler.rs
@@ -900,6 +900,7 @@ impl Compiler {
         };
 
         if let Some(global_ident) = key {
+            self.emit_warning(node.clone(), WarningKind::ShadowedGlobal(global_ident));
             self.scope_mut().poison(global_ident, depth);
         }
 
diff --git a/tvix/eval/src/warnings.rs b/tvix/eval/src/warnings.rs
index 20aa967746..5bc8ed971a 100644
--- a/tvix/eval/src/warnings.rs
+++ b/tvix/eval/src/warnings.rs
@@ -6,6 +6,7 @@ pub enum WarningKind {
     DeprecatedLiteralURL,
     UselessInherit,
     UnusedBinding,
+    ShadowedGlobal(&'static str),
 }
 
 #[derive(Debug)]