summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-01-08 11:47:15 -0800
committerOri Bernstein <ori@eigenstate.org>2015-01-08 11:47:15 -0800
commite2305586e5da4fba9f03ca4a4d2a4ec5a4c830e4 (patch)
tree423376f4af349fc5f3fd57a3eb176e8c77ed97c0 /parse
parent85185f848bae6ad2381de35eaaee64c5df16f003 (diff)
downloadmc-e2305586e5da4fba9f03ca4a4d2a4ec5a4c830e4.tar.gz
Look up declaration namespaces.
(This should be moved into getns()...)
Diffstat (limited to 'parse')
-rw-r--r--parse/infer.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/parse/infer.c b/parse/infer.c
index b152062..4b534bb 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -1070,6 +1070,7 @@ static void inferpat(Inferstate *st, Node **np, Node *val, Node ***bind, size_t
size_t i;
Node **args;
Node *s, *n;
+ Stab *ns;
Type *t;
n = *np;
@@ -1104,7 +1105,10 @@ static void inferpat(Inferstate *st, Node **np, Node *val, Node ***bind, size_t
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);