shithub: mc

Download patch

ref: 10639872d6c832f4215fca9f5d33a90b59d8021f
parent: 76c34b542f0b5c0cd6cc60a9cef9d53b6fc899d1
author: Ori Bernstein <ori@eigenstate.org>
date: Wed Mar 2 21:45:33 EST 2016

Handle hiding of traits correctly.

--- a/mbld/deps.myr
+++ b/mbld/deps.myr
@@ -11,7 +11,7 @@
 	const myrdeps	: (b : build#, mt : myrtarg#, doclean : bool, addsrc : bool -> depgraph#)
 ;;
 
-const Abiversion = 10
+const Abiversion = 11
 
 var usepat	: regex.regex#
 var cflagpat	: regex.regex#
--- a/parse/parse.h
+++ b/parse/parse.h
@@ -1,4 +1,4 @@
-#define Abiversion 10
+#define Abiversion 11
 
 typedef struct Srcloc Srcloc;
 typedef struct Tysubst Tysubst;
--- a/parse/use.c
+++ b/parse/use.c
@@ -274,7 +274,7 @@
 	size_t i;
 
 	wrint(fd, tr->uid);
-	wrbool(fd, tr->ishidden);
+	wrint(fd, tr->vis);
 	pickle(fd, tr->name);
 	typickle(fd, tr->param);
 	wrint(fd, tr->naux);
@@ -410,7 +410,8 @@
 		NULL, 0,
 		0);
 	uid = rdint(fd);
-	tr->ishidden = rdbool(fd);
+	if (rdint(fd) == Vishidden)
+		tr->ishidden = 1;
 	tr->name = unpickle(fd);
 	tr->param = tyunpickle(fd);
 	tr->naux = rdint(fd);
@@ -958,11 +959,12 @@
 		case 'R':
 			  tr = traitunpickle(f);
 			  tr->vis = vis;
-			  if (tr->vis != Vishidden)
+			  if (!tr->ishidden) {
 				  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);
+				  for (i = 0; i < tr->nfuncs; i++) {
+					  putdcl(s, tr->funcs[i]);
+					  tr->funcs[i]->decl.impls = mkht(tyhash, tyeq);
+				  }
 			  }
 			  break;
 		case 'T':