aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index c72b69af2..22b5890bb 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -1595,7 +1595,7 @@ void EvalState::callFunction(Value & fun, size_t nrArgs, Value * * args, Value &
if (!j) {
if (!i.def) {
error<TypeError>("function '%1%' called without required argument '%2%'",
- (lambda.name ? std::string(symbols[lambda.name]) : "anonymous lambda"),
+ lambda.getName(symbols),
symbols[i.name])
.atPos(lambda.pos)
.withTrace(pos, "from call site")
@@ -1621,7 +1621,7 @@ void EvalState::callFunction(Value & fun, size_t nrArgs, Value * * args, Value &
formalNames.insert(symbols[formal.name]);
auto suggestions = Suggestions::bestMatches(formalNames, symbols[i.name]);
error<TypeError>("function '%1%' called with unexpected argument '%2%'",
- (lambda.name ? std::string(symbols[lambda.name]) : "anonymous lambda"),
+ lambda.getName(symbols),
symbols[i.name])
.atPos(lambda.pos)
.withTrace(pos, "from call site")
@@ -1642,9 +1642,7 @@ void EvalState::callFunction(Value & fun, size_t nrArgs, Value * * args, Value &
? makeDebugTraceStacker(
*this, *lambda.body, env2, positions[lambda.pos],
"while calling %s",
- lambda.name
- ? concatStrings("'", symbols[lambda.name], "'")
- : "anonymous lambda")
+ lambda.getQuotedName(symbols))
: nullptr;
lambda.body->eval(*this, env2, vCur);
@@ -1654,9 +1652,7 @@ void EvalState::callFunction(Value & fun, size_t nrArgs, Value * * args, Value &
e,
lambda.pos,
"while calling %s",
- lambda.name
- ? concatStrings("'", symbols[lambda.name], "'")
- : "anonymous lambda");
+ lambda.getQuotedName(symbols));
if (pos) addErrorTrace(e, pos, "from call site");
}
throw;