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:
Vincent Ambo 2022-08-27 17:16:46 +03:00 committed by tazjin
parent 00aeb6dfaf
commit a52db14820
2 changed files with 34 additions and 0 deletions

View file

@ -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,