feat(tvix/eval): detect illegally shadowed variables
Nix does not allow things like `let a = 1; a = 2; in a`, but doing it across depths is allowed. Change-Id: I6a259f8b01a254b433b58c736e245c9c764641b6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6301 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
This commit is contained in:
parent
00aeb6dfaf
commit
a52db14820
2 changed files with 34 additions and 0 deletions
|
|
@ -32,6 +32,9 @@ pub enum ErrorKind {
|
|||
// Unknown variable in dynamic scope (with, rec, ...).
|
||||
UnknownDynamicVariable(String),
|
||||
|
||||
// User is defining the same variable twice at the same depth.
|
||||
VariableAlreadyDefined(String),
|
||||
|
||||
// Attempt to call something that is not callable.
|
||||
NotCallable,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue