aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/value-to-json.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/value-to-json.cc')
-rw-r--r--src/libexpr/value-to-json.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libexpr/value-to-json.cc b/src/libexpr/value-to-json.cc
index 7b35abca2..307934292 100644
--- a/src/libexpr/value-to-json.cc
+++ b/src/libexpr/value-to-json.cc
@@ -10,7 +10,7 @@
namespace nix {
void printValueAsJSON(EvalState & state, bool strict,
- Value & v, const Pos & pos, JSONPlaceholder & out, PathSet & context)
+ Value & v, const PosIdx pos, JSONPlaceholder & out, PathSet & context)
{
checkInterrupt();
@@ -54,10 +54,10 @@ void printValueAsJSON(EvalState & state, bool strict,
for (auto & j : names) {
Attr & a(*v.attrs->find(state.symbols.create(j)));
auto placeholder(obj.placeholder(j));
- printValueAsJSON(state, strict, *a.value, *a.pos, placeholder, context);
+ printValueAsJSON(state, strict, *a.value, a.pos, placeholder, context);
}
} else
- printValueAsJSON(state, strict, *i->value, *i->pos, out, context);
+ printValueAsJSON(state, strict, *i->value, i->pos, out, context);
break;
}
@@ -82,15 +82,15 @@ void printValueAsJSON(EvalState & state, bool strict,
case nFunction:
auto e = TypeError({
.msg = hintfmt("cannot convert %1% to JSON", showType(v)),
- .errPos = v.determinePos(pos)
+ .errPos = state.positions[v.determinePos(pos)]
});
- e.addTrace(pos, hintfmt("message for the trace"));
+ e.addTrace(state.positions[pos], hintfmt("message for the trace"));
throw e;
}
}
void printValueAsJSON(EvalState & state, bool strict,
- Value & v, const Pos & pos, std::ostream & str, PathSet & context)
+ Value & v, const PosIdx pos, std::ostream & str, PathSet & context)
{
JSONPlaceholder out(str);
printValueAsJSON(state, strict, v, pos, out, context);