Fix support for coerceToPath() on attrsets with an outPath attribute

This commit is contained in:
Eelco Dolstra 2022-05-11 15:48:21 +02:00
parent eb966921ca
commit 8b5f37ea92
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -2117,16 +2117,11 @@ SourcePath EvalState::coerceToPath(const PosIdx pos, Value & v, PathSet & contex
if (v.type() == nPath) if (v.type() == nPath)
return v.path(); return v.path();
#if 0
if (v.type() == nAttrs) { if (v.type() == nAttrs) {
auto maybeString = tryAttrsToString(pos, v, context, coerceMore, copyToStore);
if (maybeString)
return std::move(*maybeString);
auto i = v.attrs->find(sOutPath); auto i = v.attrs->find(sOutPath);
if (i == v.attrs->end()) throwTypeError(pos, "cannot coerce a set to a string"); if (i != v.attrs->end())
return coerceToString(pos, *i->value, context, coerceMore, copyToStore); return coerceToPath(pos, *i->value, context);
} }
#endif
throwTypeError(pos, "cannot coerce %1% to a path", v); throwTypeError(pos, "cannot coerce %1% to a path", v);
} }