summaryrefslogtreecommitdiff
path: root/parse/use.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-03-03 02:45:33 -0500
committerOri Bernstein <ori@eigenstate.org>2016-03-03 02:45:33 -0500
commit10639872d6c832f4215fca9f5d33a90b59d8021f (patch)
treedaced83870e04745df69b553dac9148ac0dbe6ab /parse/use.c
parent76c34b542f0b5c0cd6cc60a9cef9d53b6fc899d1 (diff)
downloadmc-10639872d6c832f4215fca9f5d33a90b59d8021f.tar.gz
Handle hiding of traits correctly.
Diffstat (limited to 'parse/use.c')
-rw-r--r--parse/use.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/parse/use.c b/parse/use.c
index 482cd7d..de95606 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -274,7 +274,7 @@ static void traitpickle(FILE *fd, Trait *tr)
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 @@ Trait *traitunpickle(FILE *fd)
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 @@ foundextlib:
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':