1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 23:11:16 +02:00

more pos reporting

This commit is contained in:
Ben Burdette 2020-05-11 17:34:57 -06:00
parent 631642c5b4
commit 7c3138844c
2 changed files with 11 additions and 5 deletions

View file

@ -267,8 +267,12 @@ 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 UndefinedVarError("undefined variable '%1%' at %2%", name, pos);
if (withLevel == -1)
throw UndefinedVarError(
ErrorInfo {
.hint = hintfmt("undefined variable '%1%'", name),
.nixCode = NixCode { .errPos = pos }
});
fromWith = true;
this->level = withLevel;
}