From 93ca9381dac7b95cdab005e653f3051c74968d51 Mon Sep 17 00:00:00 2001 From: Ben Burdette Date: Tue, 8 Jun 2021 18:37:28 -0600 Subject: [PATCH] formatting; string arg for throwTypeError --- src/libexpr/eval.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index cef0f0bc3..85bff6ee5 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -743,11 +743,11 @@ LocalNoInlineNoReturn(void throwTypeError(const Pos & pos, const char * s, const throw error; } -LocalNoInlineNoReturn(void throwTypeError(const Pos & pos, const char * s, const char * t, valmap * env)) +LocalNoInlineNoReturn(void throwTypeError(const Pos & pos, const char * s, const string &s2, valmap * env)) { auto delenv = std::unique_ptr(env); auto error = TypeError({ - .msg = hintfmt(s, t), + .msg = hintfmt(s, s2), .errPos = pos }); @@ -1516,7 +1516,7 @@ void EvalState::autoCallFunction(Bindings & args, Value & fun, Value & res) if (j != args.end()) { actualArgs->attrs->push_back(*j); } else if (!i.def) { - throwMissingArgumentError(i.pos, R"(cannot evaluate a function that has an argument without a value ('%1%') + throwMissingArgumentError(i.pos, R"(cannot evaluate a function that has an argument without a value ('%1%') Nix attempted to evaluate a function as a top level expression; in this case it must have its arguments supplied either by default @@ -1965,7 +1965,7 @@ string EvalState::coerceToString(const Pos & pos, Value & v, PathSet & context, } throwTypeError(pos, "cannot coerce %1% to a string", v, - map1("value", &v)); + map1("value", &v)); } @@ -2077,8 +2077,10 @@ bool EvalState::eqValues(Value & v1, Value & v2) return v1.fpoint == v2.fpoint; default: - throwEvalError("cannot compare %1% with %2%", showType(v1), showType(v2), - map2("value1", &v1, "value2", &v2)); + throwEvalError("cannot compare %1% with %2%", + showType(v1), + showType(v2), + map2("value1", &v1, "value2", &v2)); } }