aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/primops.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 409e6256b..509297003 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -517,9 +517,7 @@ static void prim_toPath(EvalState & state, Value * * args, Value & v)
{
PathSet context;
Path path = state.coerceToPath(*args[0], context);
- if (!context.empty())
- throw EvalError(format("string `%1%' cannot refer to other paths") % path);
- mkPath(v, canonPath(path).c_str());
+ mkString(v, canonPath(path), context);
}