shithub: mc

Download patch

ref: 9b25824592bbdd39f95203497659c37c315804a8
parent: 7e935fc4a7e5cdcd55180f6ec4821c8848c30b0e
author: Ori Bernstein <ori@eigenstate.org>
date: Thu Jan 8 06:47:15 EST 2015

Look up declaration namespaces.

    (This should be moved into getns()...)

--- a/parse/infer.c
+++ b/parse/infer.c
@@ -1070,6 +1070,7 @@
     size_t i;
     Node **args;
     Node *s, *n;
+    Stab *ns;
     Type *t;
 
     n = *np;
@@ -1104,7 +1105,10 @@
             break;
         case Oucon:     inferucon(st, n, &n->expr.isconst);     break;
         case Ovar:
-            s = getdcl(curstab(), args[0]);
+            ns = curstab();
+            if (args[0]->name.ns)
+                ns = getns_str(ns, args[0]->name.ns);
+            s = getdcl(ns, args[0]);
             if (s && !s->decl.ishidden) {
                 if (s->decl.isgeneric)
                     t = tyfreshen(st, s->decl.type);