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.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 0623e4953239..5ae4d6de8edc 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -201,6 +201,11 @@ Expr evalExpr2(EvalState & state, Expr e)
          cons == "List"))
         return e;
 
+    /* The `Closed' constructor is just a way to prevent substitutions
+       into expressions not containing free variables. */
+    if (atMatch(m, e) >> "Closed" >> e1)
+        return evalExpr(state, e1);
+
     /* Any encountered variables must be undeclared or primops. */
     if (atMatch(m, e) >> "Var" >> name) {
         PrimOp0 primOp = (PrimOp0) lookupPrimOp(state.primOps0, name);