aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/nixexpr.hh
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-06-15 11:46:31 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-06-15 11:46:31 +0200
commit7a77762961aee116e7179ea57f07e143d74aba1f (patch)
tree40d20ab8f8096bdfb662baf5c96e6725aadd4020 /src/libexpr/nixexpr.hh
parent25d64f3a30e4fe224224d0c0470204215f7e570c (diff)
parentef1b3f21b6e51007d82e8e894dd9ecec0d1c5207 (diff)
Merge branch 'errors-phase-2' of https://github.com/bburdette/nix
Diffstat (limited to 'src/libexpr/nixexpr.hh')
-rw-r--r--src/libexpr/nixexpr.hh8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh
index 25798cac6..47d0e85ec 100644
--- a/src/libexpr/nixexpr.hh
+++ b/src/libexpr/nixexpr.hh
@@ -2,6 +2,7 @@
#include "value.hh"
#include "symbol-table.hh"
+#include "error.hh"
#include <map>
@@ -235,8 +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(format("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;