about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 416d43b33b7e..fa843b5d3b15 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -2,6 +2,7 @@
 #include "parser.hh"
 #include "hash.hh"
 #include "util.hh"
+#include "store.hh"
 #include "nixexpr-ast.hh"
 
 
@@ -256,7 +257,11 @@ string coerceToStringWithContext(EvalState & state,
     
     if (matchPath(e, s)) {
         isPath = true;
-        return aterm2String(s);
+        Path path = aterm2String(s);
+        if (isInStore(path)) {
+            context = ATinsert(context, makePath(toATerm(toStorePath(path))));
+        }
+        return path;
     }
 
     if (matchAttrs(e, es)) {