ref: bc82e05805d51c1f58cd2e0f9b3ba098522b8ad9
parent: d8db95adb1f48b620cebfd76a9debedd84b6b66d
author: Ori Bernstein <ori@eigenstate.org>
date: Tue Jul 12 09:05:13 EDT 2016
don't completely fuck up trait exports.
--- a/parse/export.c
+++ b/parse/export.c
@@ -278,6 +278,7 @@
continue;
tagnode(st, s, 0, hidelocal);
tr = s->impl.trait;
+ tagtrait(st, tr, 0, hidelocal);
for (j = 0; j < tr->naux; j++)
tr->aux[j]->vis = Visexport;
}
--- a/parse/use.c
+++ b/parse/use.c
@@ -400,6 +400,7 @@
Trait *traitunpickle(FILE *fd)
{
Trait *tr;
+ Node *fn;
size_t i, n;
intptr_t uid;
@@ -423,8 +424,11 @@
for (i = 0; i < n; i++)
lappend(&tr->memb, &tr->nmemb, rdsym(fd, tr));
n = rdint(fd);
- for (i = 0; i < n; i++)
- lappend(&tr->funcs, &tr->nfuncs, rdsym(fd, tr));
+ for (i = 0; i < n; i++) {
+ fn = rdsym(fd, tr);
+ fn->decl.impls = mkht(tyhash, tyeq);
+ lappend(&tr->funcs, &tr->nfuncs, fn);
+ }
htput(trmap, itop(uid), tr);
return tr;
}
@@ -963,7 +967,6 @@
puttrait(s, tr->name, tr);
for (i = 0; i < tr->nfuncs; i++) {
putdcl(s, tr->funcs[i]);
- tr->funcs[i]->decl.impls = mkht(tyhash, tyeq);
}
}
break;