diff --git a/lix/libcmd/repl.cc b/lix/libcmd/repl.cc index 782175098..f8f994479 100644 --- a/lix/libcmd/repl.cc +++ b/lix/libcmd/repl.cc @@ -1036,7 +1036,7 @@ Value * NixRepl::replInitInfo() void NixRepl::addAttrsToScope(Value & attrs) { - state.forceAttrs(attrs, [&]() { return attrs.determinePos(noPos); }, "while evaluating an attribute set to be merged in the global scope"); + state.forceAttrs(attrs, attrs.determinePos(noPos), "while evaluating an attribute set to be merged in the global scope"); if (displ + attrs.attrs->size() >= envSize) throw Error("environment full; cannot add more variables"); diff --git a/lix/libexpr/eval-inline.hh b/lix/libexpr/eval-inline.hh index 07605f6b7..38b5c84d4 100644 --- a/lix/libexpr/eval-inline.hh +++ b/lix/libexpr/eval-inline.hh @@ -89,15 +89,6 @@ void EvalState::forceValue(Value & v, const PosIdx pos) [[gnu::always_inline]] inline void EvalState::forceAttrs(Value & v, const PosIdx pos, std::string_view errorCtx) { - forceAttrs(v, [&]() { return pos; }, errorCtx); -} - - -template -[[gnu::always_inline]] -inline void EvalState::forceAttrs(Value & v, Callable getPos, std::string_view errorCtx) -{ - PosIdx pos = getPos(); forceValue(v, pos); if (v.type() != nAttrs) { error( diff --git a/lix/libexpr/eval.cc b/lix/libexpr/eval.cc index 26021a509..aaeb72e37 100644 --- a/lix/libexpr/eval.cc +++ b/lix/libexpr/eval.cc @@ -1099,7 +1099,7 @@ void ExprAttrs::eval(EvalState & state, Env & env, Value & v) Hence we need __overrides.) */ if (hasOverrides) { Value * vOverrides = (*v.attrs)[overrides->second.displ].value; - state.forceAttrs(*vOverrides, [&]() { return vOverrides->determinePos(noPos); }, "while evaluating the `__overrides` attribute"); + state.forceAttrs(*vOverrides, vOverrides->determinePos(noPos), "while evaluating the `__overrides` attribute"); Bindings * newBnds = state.mem.allocBindings(v.attrs->capacity() + vOverrides->attrs->size()); for (auto & i : *v.attrs) newBnds->push_back(i); diff --git a/lix/libexpr/eval.hh b/lix/libexpr/eval.hh index 27dad80bc..808e445ee 100644 --- a/lix/libexpr/eval.hh +++ b/lix/libexpr/eval.hh @@ -476,10 +476,6 @@ public: bool forceBool(Value & v, const PosIdx pos, std::string_view errorCtx); void forceAttrs(Value & v, const PosIdx pos, std::string_view errorCtx); - - template - inline void forceAttrs(Value & v, Callable getPos, std::string_view errorCtx); - inline void forceList(Value & v, const PosIdx pos, std::string_view errorCtx); /** * @param v either lambda or primop