mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-11 00:36:20 +02:00
Fix support for coerceToPath() on attrsets with an outPath attribute
This commit is contained in:
parent
eb966921ca
commit
8b5f37ea92
1 changed files with 2 additions and 7 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue