summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-10-18 23:19:22 -0700
committerOri Bernstein <ori@eigenstate.org>2017-10-18 23:20:12 -0700
commit4770743d640a13ae81110b4161f0eb6eff9c0be1 (patch)
tree8874dc7a1cf4ec66389812cbbd3b7f760612a962 /parse
parent50fe381eba833d4bbeaa3cc634b87c2d211df79f (diff)
downloadmc-4770743d640a13ae81110b4161f0eb6eff9c0be1.tar.gz
Look up the proto before attaching the gimpls.
This means we don't lose the gimpls when they come from a file other than the one they're implemented in.
Diffstat (limited to 'parse')
-rw-r--r--parse/use.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/parse/use.c b/parse/use.c
index 51c0f85..cb0a2cd 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -857,6 +857,7 @@ protomap(Trait *tr, Type *ty, Node *dcl)
dclname = declname(dcl);
for (i = 0; i < tr->nproto; i++) {
proto = tr->proto[i];
+ proto = getdcl(curstab(), proto->decl.name);
protoname = declname(proto);
len = strlen(protoname);
p = strstr(dclname, protoname);
@@ -996,12 +997,11 @@ foundextlib:
break;
case 'R':
tr = traitunpickle(f);
- if (!tr->ishidden) {
- tr->vis = vis;
- puttrait(s, tr->name, tr);
- for (i = 0; i < tr->nproto; i++) {
- putdcl(s, tr->proto[i]);
- }
+ tr->vis = vis;
+ puttrait(s, tr->name, tr);
+ for (i = 0; i < tr->nproto; i++) {
+ putdcl(s, tr->proto[i]);
+ tr->proto[i]->decl.ishidden = tr->ishidden;
}
break;
case 'T':
@@ -1043,7 +1043,6 @@ foundextlib:
}
fixtypemappings(s);
fixtraitmappings(s);
- fiximplmappings(s);
htfree(tidmap);
for (i = starttype; i < ntypes; i++) {
ty = types[i];
@@ -1075,6 +1074,7 @@ foundextlib:
bindtype(impl->impl.env, impl->impl.type);
}
}
+ fiximplmappings(s);
popstab();
return 1;
}