mirror of
https://github.com/NixOS/nix
synced 2025-06-25 14:51:16 +02:00
Show the exact position of undefined variables
In particular, undefined variable errors in a "with" previously didn't show *any* position information, so this should help a lot in those cases.
This commit is contained in:
parent
a5e0f64db3
commit
6b47de580f
4 changed files with 18 additions and 21 deletions
|
@ -198,7 +198,7 @@ void ExprVar::bindVars(const StaticEnv & env)
|
|||
/* Otherwise, the variable must be obtained from the nearest
|
||||
enclosing `with'. If there is no `with', then we can issue an
|
||||
"undefined variable" error now. */
|
||||
if (withLevel == -1) throw EvalError(format("undefined variable `%1%'") % name);
|
||||
if (withLevel == -1) throw ParseError(format("undefined variable `%1%' at %2%") % name % pos);
|
||||
|
||||
fromWith = true;
|
||||
this->level = withLevel;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue