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

new pos format for more errors

This commit is contained in:
Ben Burdette 2020-05-12 10:52:26 -06:00
parent 7c3138844c
commit ec870b9c85
5 changed files with 35 additions and 12 deletions

View file

@ -236,7 +236,11 @@ struct ExprLambda : Expr
: pos(pos), arg(arg), matchAttrs(matchAttrs), formals(formals), body(body)
{
if (!arg.empty() && formals && formals->argNames.find(arg) != formals->argNames.end())
throw ParseError("duplicate formal function argument '%1%' at %2%", arg, pos);
throw ParseError(
ErrorInfo {
.hint = hintfmt("duplicate formal function argument '%1%'", arg),
.nixCode = NixCode { .errPos = pos }
});
};
void setName(Symbol & name);
string showNamePos() const;