shithub: mc

Download patch

ref: 79bd9957c85b57f31089719c9715e66e99296bbc
parent: 505618290f159d5453d2e86abdb8f4297e846f74
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Dec 25 15:39:57 EST 2015

Export aux types correctly.

	We were skipping marking them writable and exporting them.
	Oops.

--- a/parse/infer.c
+++ b/parse/infer.c
@@ -2400,6 +2400,8 @@
 		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 @@
 	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);
 
--- a/parse/use.c
+++ b/parse/use.c
@@ -415,9 +415,9 @@
 	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++)