ref: 26ac18e94d9f64f5153c51cf6d6151367ea0dfd7
parent: d4862853ca810b97d1adc2944f32975fd4a5018f
author: Ori Bernstein <[email protected]>
date: Sat Oct 21 15:55:18 EDT 2017
Set the ns on impl decls to match the impl ns.
--- a/parse/node.c
+++ b/parse/node.c
@@ -247,6 +247,7 @@
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 @@
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);