summaryrefslogtreecommitdiff
path: root/parse/type.c
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2019-02-09 21:48:50 -0800
committerOri Bernstein <ori@eigenstate.org>2019-02-09 21:48:50 -0800
commita8ab64015b9419f0a32c1162c2442c27163dff66 (patch)
tree391e7008d65ec9b2751ce51d29fa3e1abe7606fb /parse/type.c
parentbe26bedd4883ebc3679ece90df4ba508fee87f8e (diff)
downloadmc-a8ab64015b9419f0a32c1162c2442c27163dff66.tar.gz
Work towards removing the streq check.
Diffstat (limited to 'parse/type.c')
-rw-r--r--parse/type.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/parse/type.c b/parse/type.c
index a0c2855..4f12b24 100644
--- a/parse/type.c
+++ b/parse/type.c
@@ -792,7 +792,7 @@ equate(int32_t ta, int32_t tb)
int
tyeq_rec(Type *a, Type *b, Bitset *avisited, Bitset *bvisited, int search)
{
- Type *x, *y;
+ Type *x, *y, *t;
Typair p;
size_t i;
int ret;
@@ -802,6 +802,10 @@ tyeq_rec(Type *a, Type *b, Bitset *avisited, Bitset *bvisited, int search)
if (search) {
a = tysearch(a);
b = tysearch(b);
+ if ((t = boundtype(a)) != NULL)
+ a = tysearch(t);
+ if ((t = boundtype(b)) != NULL)
+ b = tysearch(t);
}
if (a->type != b->type)
return 0;
@@ -829,7 +833,9 @@ tyeq_rec(Type *a, Type *b, Bitset *avisited, Bitset *bvisited, int search)
switch (a->type) {
case Typaram:
- ret = streq(a->pname, b->pname);
+ ret = (a == b);
+ /* FIXME: this streq check needs to go */
+ ret = ret || streq(a->pname, b->pname);
break;
case Tyvar:
if (a->tid != b->tid)