ref: 39331f834db694be103a7ecb1aac3ba2cc5279fc
parent: f4a939a2cfdc00643b02c404b0acbed382964dd0
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Dec 30 15:10:45 EST 2017
Clean up some more dead code.
--- a/lib/iter/test/reverse.myr
+++ b/lib/iter/test/reverse.myr
@@ -2,11 +2,10 @@
use iter
const main = {
- var n, l : int[:]
+ var n
n = 0
- l = [3, 2, 1, 0][:]
- for x : iter.byreverse(l)
+ for x : iter.byreverse([3, 2, 1, 0][:])
std.assert(x == n, "invalid reversed value {}, expected {}", x, n)
n++
;;
--- a/lib/iter/test/zip.myr
+++ b/lib/iter/test/zip.myr
@@ -2,12 +2,10 @@
use iter
const main = {
- var n, la : int[:], lb : int[:]
+ var n
n = 0
- la = [0,2,4,6,8][:]
- lb = [2,4][:]
- for (a, b) : iter.byzip(la, lb)
+ for (a, b) : iter.byzip([0,2,4,6,8][:], [2,4][:])
std.assert(a == n*2, "invalid val from a: {}", a)
std.assert(b == n*2 + 2, "invalid val from b: {}", b)
n++
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -754,20 +754,6 @@
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 @@
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 @@
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;