From 8b5f37ea9258f01f1727317cfc8b0dd866df7e6a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 11 May 2022 15:48:21 +0200 Subject: [PATCH] Fix support for coerceToPath() on attrsets with an outPath attribute --- src/libexpr/eval.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 2dd428d7e..f2616407f 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -2117,16 +2117,11 @@ SourcePath EvalState::coerceToPath(const PosIdx pos, Value & v, PathSet & contex if (v.type() == nPath) return v.path(); - #if 0 if (v.type() == nAttrs) { - auto maybeString = tryAttrsToString(pos, v, context, coerceMore, copyToStore); - if (maybeString) - return std::move(*maybeString); auto i = v.attrs->find(sOutPath); - if (i == v.attrs->end()) throwTypeError(pos, "cannot coerce a set to a string"); - return coerceToString(pos, *i->value, context, coerceMore, copyToStore); + if (i != v.attrs->end()) + return coerceToPath(pos, *i->value, context); } - #endif throwTypeError(pos, "cannot coerce %1% to a path", v); }