diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 790b00ace..6c89b87b7 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -860,18 +860,18 @@ LocalNoInlineNoReturn(void throwTypeError(const Pos & pos, const char * s, const throw error; } -LocalNoInlineNoReturn(void throwTypeError(const Pos & pos, const char * s, const string &s2, Env & env, Expr *expr)) -{ - auto error = TypeError({ - .msg = hintfmt(s, s2), - .errPos = pos - }); +// LocalNoInlineNoReturn(void throwTypeError(const Pos & pos, const char * s, const string &s2, Env & env, Expr *expr)) +// { +// auto error = TypeError({ +// .msg = hintfmt(s, s2), +// .errPos = pos +// }); - if (debuggerHook && expr) - debuggerHook(&error, env, *expr); +// if (debuggerHook && expr) +// debuggerHook(&error, env, *expr); - throw error; -} +// throw error; +// } LocalNoInlineNoReturn(void throwTypeError(const Pos & pos, const char * s, const ExprLambda & fun, const Symbol & s2, Env & env, Expr *expr)) { @@ -1243,7 +1243,7 @@ inline bool EvalState::evalBool(Env & env, Expr * e) Value v; e->eval(*this, env, v); if (v.type() != nBool) - throwTypeError("value is %1% while a Boolean was expected", v); + throwTypeError(noPos, "value is %1% while a Boolean was expected", v); return v.boolean; } @@ -1262,7 +1262,7 @@ inline void EvalState::evalAttrs(Env & env, Expr * e, Value & v) { e->eval(*this, env, v); if (v.type() != nAttrs) - throwTypeError("value is %1% while a set was expected", v); + throwTypeError(noPos, "value is %1% while a set was expected", v); } diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index 8c4430bc8..a7d1207f2 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -195,7 +195,7 @@ public: Expr * parseExprFromFile(const Path & path, std::shared_ptr & staticEnv); /* Parse a Nix expression from the specified string. */ - Expr * parseExprFromString(std::string s, const Path & basePath, , std::shared_ptr & staticEnv); + Expr * parseExprFromString(std::string s, const Path & basePath, std::shared_ptr & staticEnv); Expr * parseExprFromString(std::string s, const Path & basePath); Expr * parseStdin(); @@ -331,7 +331,7 @@ private: friend struct ExprLet; Expr * parse(char * text, size_t length, FileOrigin origin, const PathView path, - const Path & basePath, std::shared_ptr & staticEnv); + const PathView basePath, std::shared_ptr & staticEnv); public: