summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-10-21 19:55:18 -0700
committerOri Bernstein <ori@eigenstate.org>2017-10-21 19:56:18 -0700
commit26ac18e94d9f64f5153c51cf6d6151367ea0dfd7 (patch)
tree5c9af0608571f077d6a630ad919de7ff23bfed37
parentd4862853ca810b97d1adc2944f32975fd4a5018f (diff)
downloadmc-26ac18e94d9f64f5153c51cf6d6151367ea0dfd7.tar.gz
Set the ns on impl decls to match the impl ns.
-rw-r--r--parse/node.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/parse/node.c b/parse/node.c
index 34fdd74..957a15e 100644
--- a/parse/node.c
+++ b/parse/node.c
@@ -247,6 +247,7 @@ Node *
mkimplstmt(Srcloc loc, Node *name, Type *t, Type **aux, size_t naux, Node **decls, size_t ndecls)
{
Node *n;
+ size_t i;
n = mknode(loc, Nimpl);
n->impl.traitname = name;
@@ -256,6 +257,9 @@ mkimplstmt(Srcloc loc, Node *name, Type *t, Type **aux, size_t naux, Node **decl
n->impl.decls = decls;
n->impl.ndecls = ndecls;
lappend(&impltab, &nimpltab, n);
+ if (name->name.ns)
+ for (i = 0; i < ndecls; i++)
+ setns(decls[i]->decl.name, name->name.ns);
if (hasparams(t)) {
n->impl.env = mkenv();
bindtype(n->impl.env, t);