diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index bfe6c01dd..08ec2fac4 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -1617,7 +1617,8 @@ void EvalState::callFunction(Value & fun, size_t nrArgs, Value * * args, Value & (lambda.name ? concatStrings("'", symbols[lambda.name], "'") : "anonymous lambda")); - addErrorTrace(e, pos, "from call site%s", ""); + if (pos != noPos) + addErrorTrace(e, pos, "from call site", ""); } throw; } diff --git a/src/libexpr/nixexpr.hh b/src/libexpr/nixexpr.hh index 281881543..efd238211 100644 --- a/src/libexpr/nixexpr.hh +++ b/src/libexpr/nixexpr.hh @@ -52,7 +52,11 @@ public: explicit operator bool() const { return id > 0; } - bool operator<(const PosIdx other) const { return id < other.id; } + bool operator <(const PosIdx other) const { return id < other.id; } + + bool operator ==(const PosIdx other) const { return id == other.id; } + + bool operator !=(const PosIdx other) const { return id != other.id; } }; class PosTable diff --git a/src/libutil/error.cc b/src/libutil/error.cc index fa825b2f6..f570dca1d 100644 --- a/src/libutil/error.cc +++ b/src/libutil/error.cc @@ -30,12 +30,12 @@ const std::string & BaseError::calcWhat() const std::optional ErrorInfo::programName = std::nullopt; -std::ostream & operator<<(std::ostream & os, const hintformat & hf) +std::ostream & operator <<(std::ostream & os, const hintformat & hf) { return os << hf.str(); } -std::ostream & operator << (std::ostream & str, const AbstractPos & pos) +std::ostream & operator <<(std::ostream & str, const AbstractPos & pos) { pos.print(str); str << ":" << pos.line;