aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-12-13 19:20:48 +0100
committerEelco Dolstra <edolstra@gmail.com>2021-12-13 19:20:48 +0100
commitcc6406cc598bff1f395616ee13716ac9a3510097 (patch)
tree756eb7a967867069469d89650d36e6a90eec926f /src/libexpr/eval.cc
parent2567b74c66ed52f752578373d4ec81ac2f09d6f0 (diff)
parent9d67332e4b8d75a101b8cf6e1d7e4dc8e99e964a (diff)
Merge branch 'better-interpolation-error-location' of https://github.com/greedy/nix
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index b987e1888..8cf4d9549 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -1656,7 +1656,7 @@ void ExprConcatStrings::eval(EvalState & state, Env & env, Value & v)
bool first = !forceString;
ValueType firstType = nString;
- for (auto & i : *es) {
+ for (auto & [i_pos, i] : *es) {
Value vTmp;
i->eval(state, env, vTmp);
@@ -1677,19 +1677,19 @@ void ExprConcatStrings::eval(EvalState & state, Env & env, Value & v)
nf = n;
nf += vTmp.fpoint;
} else
- throwEvalError(pos, "cannot add %1% to an integer", showType(vTmp));
+ throwEvalError(i_pos, "cannot add %1% to an integer", showType(vTmp));
} else if (firstType == nFloat) {
if (vTmp.type() == nInt) {
nf += vTmp.integer;
} else if (vTmp.type() == nFloat) {
nf += vTmp.fpoint;
} else
- throwEvalError(pos, "cannot add %1% to a float", showType(vTmp));
+ throwEvalError(i_pos, "cannot add %1% to a float", showType(vTmp));
} else
/* skip canonization of first path, which would only be not
canonized in the first place if it's coming from a ./${foo} type
path */
- s << state.coerceToString(pos, vTmp, context, false, firstType == nString, !first);
+ s << state.coerceToString(i_pos, vTmp, context, false, firstType == nString, !first);
first = false;
}