summaryrefslogtreecommitdiff
path: root/parse/infer.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-12-30 20:10:45 -0800
committerOri Bernstein <ori@eigenstate.org>2017-12-30 20:10:45 -0800
commit39331f834db694be103a7ecb1aac3ba2cc5279fc (patch)
treee8862a070c8946b37a907d901f4812191f3ec2d3 /parse/infer.c
parentf4a939a2cfdc00643b02c404b0acbed382964dd0 (diff)
downloadmc-39331f834db694be103a7ecb1aac3ba2cc5279fc.tar.gz
Clean up some more dead code.
Diffstat (limited to 'parse/infer.c')
-rw-r--r--parse/infer.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/parse/infer.c b/parse/infer.c
index 20360ac..55628a5 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -754,20 +754,6 @@ uconresolve(Node *n)
return uc;
}
-/* Binds the type parameters in the
- * declaration into the type environment */
-void
-_bind(Tyenv *e, Node *n)
-{
- assert(n->type == Ndecl);
- if(!n->decl.isgeneric)
- return;
- ingeneric++;
- bindtype(e, n->decl.type);
- if (n->decl.init)
- bindtype(e, n->decl.init->expr.type);
-}
-
/* this doesn't walk through named types, so it can't recurse infinitely. */
int
tymatchrank(Type *pat, Type *to)
@@ -2206,8 +2192,8 @@ tyfix(Node *ctx, Type *orig, int noerr)
unify(ctx, t, d);
t = tf(t);
} else if (tybase(t)->type != d->type && !noerr) {
- fatal(ctx, "type %s not compatible with %s near %s\n", tystr(t),
- tystr(d), ctxstr(ctx));
+ fatal(ctx, "type %s not compatible with %s near %s\n",
+ tystr(t), tystr(d), ctxstr(ctx));
}
}
if (t->type == Tyvar && t->trneed) {
@@ -2243,7 +2229,7 @@ tyfix(Node *ctx, Type *orig, int noerr)
if (t->type == Tyvar && !noerr)
fatal(ctx, "underconstrained type %s near %s", tyfmt(buf, 1024, t), ctxstr(ctx));
if (base)
- htput(seqbase, t, base);
+ htput(seqbase, t, tyfix(ctx, base, noerr));
if (env)
popenv(env);
return t;