summaryrefslogtreecommitdiff
path: root/parse
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-12-25 20:39:57 -0800
committerOri Bernstein <ori@eigenstate.org>2015-12-25 20:39:57 -0800
commit79bd9957c85b57f31089719c9715e66e99296bbc (patch)
tree580f81b821e9fa79c5f6c0a4dc1d130b9a9b405c /parse
parent505618290f159d5453d2e86abdb8f4297e846f74 (diff)
downloadmc-79bd9957c85b57f31089719c9715e66e99296bbc.tar.gz
Export aux types correctly.
We were skipping marking them writable and exporting them. Oops.
Diffstat (limited to 'parse')
-rw-r--r--parse/infer.c9
-rw-r--r--parse/use.c6
2 files changed, 10 insertions, 5 deletions
diff --git a/parse/infer.c b/parse/infer.c
index 10be7dd..f221df4 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -2400,6 +2400,8 @@ void tagexports(Node *file, int hidelocal)
tr = gettrait(st, k[j]);
if (tr->vis == Visexport) {
tr->param->vis = Visexport;
+ for (i = 0; i < tr->naux; i++)
+ tr->aux[i]->vis = Visexport;
for (i = 0; i < tr->nmemb; i++) {
tr->memb[i]->decl.vis = Visexport;
nodetag(st, tr->memb[i], 0, hidelocal);
@@ -2416,8 +2418,11 @@ void tagexports(Node *file, int hidelocal)
k = htkeys(st->impl, &n);
for (i = 0; i < n; i++) {
s = getimpl(st, k[i]);
- if (s->impl.vis == Visexport)
- nodetag(st, s, 0, hidelocal);
+ if (s->impl.vis != Visexport)
+ continue;
+ nodetag(st, s, 0, hidelocal);
+ for (i = 0; i < tr->naux; i++)
+ tr->aux[i]->vis = Visexport;
}
free(k);
diff --git a/parse/use.c b/parse/use.c
index 24e8da7..949e069 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -415,9 +415,9 @@ Trait *traitunpickle(FILE *fd)
tr->ishidden = rdbool(fd);
tr->name = unpickle(fd);
tr->param = tyunpickle(fd);
- n = rdint(fd);
- tr->aux = zalloc(n * sizeof(Type*));
- for (i = 0; i < n; i++)
+ tr->naux = rdint(fd);
+ tr->aux = zalloc(tr->naux * sizeof(Type*));
+ for (i = 0; i < tr->naux; i++)
rdtype(fd, &tr->aux[i]);
n = rdint(fd);
for (i = 0; i < n; i++)