aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorBen Burdette <bburdette@users.noreply.github.com>2022-05-09 09:30:44 -0600
committerGitHub <noreply@github.com>2022-05-09 09:30:44 -0600
commit7cd7c7c91aec7a49e99a8f403cb4ef4932a02b20 (patch)
tree06504de8c9b22a85eaf239e094499dc512c891f2 /src/libexpr/eval.cc
parentfc66f48812383dad59ebdbabdd29bec34ed31921 (diff)
parent3ec979fa902c49e975a9af7dc2792fb197030e04 (diff)
Merge branch 'master' into debug-exploratory-PR
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index c5e33a279..003fbdf11 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -147,7 +147,10 @@ void Value::print(const SymbolTable & symbols, std::ostream & str,
else {
str << "[ ";
for (auto v2 : listItems()) {
- v2->print(symbols, str, seen);
+ if (v2)
+ v2->print(symbols, str, seen);
+ else
+ str << "(nullptr)";
str << " ";
}
str << "]";
@@ -184,6 +187,11 @@ void Value::print(const SymbolTable & symbols, std::ostream & str, bool showRepe
print(symbols, str, showRepeated ? nullptr : &seen);
}
+// Pretty print types for assertion errors
+std::ostream & operator << (std::ostream & os, const ValueType t) {
+ os << showType(t);
+ return os;
+}
std::string printValue(const EvalState & state, const Value & v)
{
@@ -1855,7 +1863,7 @@ void EvalState::autoCallFunction(Bindings & args, Value & fun, Value & res)
Nix attempted to evaluate a function as a top level expression; in
this case it must have its arguments supplied either by default
values, or passed explicitly with '--arg' or '--argstr'. See
-https://nixos.org/manual/nix/stable/#ss-functions.)", symbols[i.name],
+https://nixos.org/manual/nix/stable/expressions/language-constructs.html#functions.)", symbols[i.name],
*fun.lambda.env, *fun.lambda.fun);
}
}