shithub: mc

Download patch

ref: e1bc2dfb1c4a93d4d6def1a2a24a08165040a4b8
parent: 1f224c74db8ada97c2404cd8ac2c1a3aacafd4d9
author: Ori Bernstein <[email protected]>
date: Fri Aug 9 14:50:54 EDT 2013

Look up names by namespace.

--- a/parse/infer.c
+++ b/parse/infer.c
@@ -353,9 +353,15 @@
 {
     Ucon *uc;
     Node **args;
+    Stab *ns;
 
     args = n->expr.args;
-    uc = getucon(curstab(), args[0]);
+    ns = curstab();
+    if (args[0]->name.ns)
+        ns = getns_str(ns, args[0]->name.ns);
+    if (!ns)
+        fatal(n->line, "No namespace %s\n", args[0]->name.ns);
+    uc = getucon(ns, args[0]);
     if (!uc)
         fatal(n->line, "no union constructor `%s", ctxstr(st, args[0]));
     if (!uc->etype && n->expr.nargs > 1)