summaryrefslogtreecommitdiff
path: root/parse/type.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2016-01-31 01:18:59 -0800
committerOri Bernstein <ori@eigenstate.org>2016-01-31 01:18:59 -0800
commitb1a3d3df704e61aa55c34c623380967f06700b41 (patch)
treeb5505525306a2bac63bdf1f929a3414f527d862b /parse/type.c
parentf7141e2d8ed52e0fb493810ea71adf22fa57a49e (diff)
downloadmc-b1a3d3df704e61aa55c34c623380967f06700b41.tar.gz
Fix missing tysearch()
We were erronously saying that two types were not equal, even though we'd already unified them.
Diffstat (limited to 'parse/type.c')
-rw-r--r--parse/type.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/parse/type.c b/parse/type.c
index 4224845..d711b6b 100644
--- a/parse/type.c
+++ b/parse/type.c
@@ -667,6 +667,8 @@ int tyeq_rec(Type *a, Type *b, Bitset *visited)
if (!a || !b)
return a == b;
+ a = tysearch(a);
+ b = tysearch(b);
if (a->type != b->type)
return 0;
if (a->narg != b->narg)
@@ -685,7 +687,9 @@ int tyeq_rec(Type *a, Type *b, Bitset *visited)
bsput(visited, b->tid);
switch (a->type) {
- case Typaram: return streq(a->pname, b->pname); break;
+ case Typaram:
+ return streq(a->pname, b->pname);
+ break;
case Tyvar:
if (a->tid != b->tid)
return 0;