summaryrefslogtreecommitdiff
path: root/parse/use.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-12-24 18:46:34 -0800
committerOri Bernstein <ori@eigenstate.org>2015-12-24 18:46:34 -0800
commit3dc461b0b09aae0b89c6310fe572f1bd7f693395 (patch)
tree923ed5809bdcf00fce5321a50aefd7bdac8afd34 /parse/use.c
parentee50a71ce18d4721e868e575d26d894bc8f13e37 (diff)
downloadmc-3dc461b0b09aae0b89c6310fe572f1bd7f693395.tar.gz
Fix importing/exporting traits.
Diffstat (limited to 'parse/use.c')
-rw-r--r--parse/use.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/parse/use.c b/parse/use.c
index 72df142..7390b21 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -821,7 +821,7 @@ static void protomap(Trait *tr, Type *ty, Node *dcl)
for (i = 0; i < tr->nfuncs; i++) {
protoname = declname(tr->funcs[i]);
len = strlen(protoname);
- if (strstr(dclname, protoname) == dclname && dclname[len] == '$')
+ if (strstr(dclname, protoname))
htput(tr->funcs[i]->decl.impls, ty, dcl);
}
}
@@ -837,8 +837,9 @@ static void fiximplmappings(Stab *st)
tr = impl->impl.trait;
/* FIXME: handle duplicate impls properly */
- if (!getimpl(st, impl))
- putimpl(st, impl);
+ if (getimpl(st, impl))
+ continue;
+ putimpl(st, impl);
settrait(impl->impl.type, tr);
for (j = 0; j < impl->impl.ndecls; j++) {
putdcl(file->file.globls, impl->impl.decls[j]);
@@ -979,6 +980,8 @@ foundextlib:
break;
case 'I':
impl = unpickle(f);
+ impl->impl.isextern = 1;
+ impl->impl.vis = vis;
/* specialized declarations always go into the global stab */
for (i = 0; i < impl->impl.ndecls; i++) {
impl->impl.decls[i]->decl.isglobl = 1;