about summary refs log tree commit diff
path: root/src/libexpr/nixexpr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/nixexpr.cc')
-rw-r--r--src/libexpr/nixexpr.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index 3675dcceaf66..e581b1329c88 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -114,23 +114,19 @@ static void varsBoundByPattern(ATermMap & map, Pattern pat)
 {
     ATerm name;
     ATermList formals;
-    Pattern pat1, pat2;
     ATermBool ellipsis;
     /* Use makeRemoved() so that it can be used directly in
        substitute(). */
     if (matchVarPat(pat, name))
         map.set(name, makeRemoved());
-    else if (matchAttrsPat(pat, formals, ellipsis)) { 
+    else if (matchAttrsPat(pat, formals, ellipsis, name)) {
+        if (name != sNoAlias) map.set(name, makeRemoved());
         for (ATermIterator i(formals); i; ++i) {
             ATerm d1;
             if (!matchFormal(*i, name, d1)) abort();
             map.set(name, makeRemoved());
         }
     }
-    else if (matchAtPat(pat, pat1, pat2)) {
-        varsBoundByPattern(map, pat1);
-        varsBoundByPattern(map, pat2);
-    }
     else abort();
 }