summaryrefslogtreecommitdiff
path: root/parse/use.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-02-06 22:38:29 -0800
committerOri Bernstein <ori@eigenstate.org>2016-02-07 01:16:49 -0800
commit03857943018a82e1101cecbb026b5e11f4061dc5 (patch)
treef3bec664245228aa862cf28f35d0a6aeca899d14 /parse/use.c
parent061c7f286ebf2ee6e0afb0a0fb2b90397b848e23 (diff)
downloadmc-03857943018a82e1101cecbb026b5e11f4061dc5.tar.gz
Generic iterators now seem to work.
Diffstat (limited to 'parse/use.c')
-rw-r--r--parse/use.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/parse/use.c b/parse/use.c
index f1dbb71..2033fa7 100644
--- a/parse/use.c
+++ b/parse/use.c
@@ -821,8 +821,10 @@ static void protomap(Trait *tr, Type *ty, Node *dcl)
protoname = declname(proto);
len = strlen(protoname);
p = strstr(dclname, protoname);
- if (p && p[len] == '$')
- htput(proto->decl.__impls, ty, dcl);
+ if (!p || p[len] != '$') {
+ continue;
+ }
+ htput(proto->decl.impls, ty, dcl);
if (ty->type == Tygeneric || hasparams(ty)) {
lappend(&proto->decl.gimpl, &proto->decl.ngimpl, dcl);
lappend(&proto->decl.gtype, &proto->decl.ngtype, ty);
@@ -954,7 +956,7 @@ foundextlib:
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);
+ tr->funcs[i]->decl.impls = mkht(tyhash, tyeq);
}
break;
case 'T':