diff --git a/lix/libexpr/eval-error.cc b/lix/libexpr/eval-error.cc index 325510ec9..3557138f4 100644 --- a/lix/libexpr/eval-error.cc +++ b/lix/libexpr/eval-error.cc @@ -19,12 +19,6 @@ EvalErrorBuilder EvalErrorBuilder::atPos(PosIdx pos) && return std::move(*this); } -template T> -EvalErrorBuilder EvalErrorBuilder::atPos(Value & value, PosIdx fallback) && -{ - return std::move(*this).atPos(value.determinePos(fallback)); -} - template T> EvalErrorBuilder EvalErrorBuilder::withTrace(PosIdx pos, const std::string_view text) && { diff --git a/lix/libexpr/eval-error.hh b/lix/libexpr/eval-error.hh index e8f2a6a5c..faa9953b4 100644 --- a/lix/libexpr/eval-error.hh +++ b/lix/libexpr/eval-error.hh @@ -76,8 +76,6 @@ public: [[gnu::noinline]] EvalErrorBuilder atPos(PosIdx pos) &&; - [[gnu::noinline]] EvalErrorBuilder atPos(Value & value, PosIdx fallback = noPos) &&; - [[gnu::noinline]] EvalErrorBuilder withTrace(PosIdx pos, const std::string_view text) &&; [[gnu::noinline]] EvalErrorBuilder withSuggestions(Suggestions & s) &&; diff --git a/lix/libexpr/value.cc b/lix/libexpr/value.cc index 5aea57096..103505db7 100644 --- a/lix/libexpr/value.cc +++ b/lix/libexpr/value.cc @@ -35,20 +35,6 @@ void Value::print(EvalState & state, std::ostream & str, PrintOptions options) printValue(state, str, *this, options); } -PosIdx Value::determinePos(const PosIdx pos) const -{ - // Allow selecting a subset of enum values - #pragma GCC diagnostic push - #pragma GCC diagnostic ignored "-Wswitch-enum" - switch (internalType) { - case tAttrs: return attrs->pos; - case tLambda: return lambda.fun->pos; - case tApp: return app.left->determinePos(pos); - default: return pos; - } - #pragma GCC diagnostic pop -} - bool Value::isTrivial() const { return diff --git a/lix/libexpr/value.hh b/lix/libexpr/value.hh index 275f003c1..c15d5335f 100644 --- a/lix/libexpr/value.hh +++ b/lix/libexpr/value.hh @@ -790,8 +790,6 @@ public: return internalType == tList1 ? 1 : internalType == tList2 ? 2 : bigList.size; } - PosIdx determinePos(const PosIdx pos) const; - /** * Check whether forcing this value requires a trivial amount of * computation. In particular, function applications are