summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2017-09-16 14:07:30 -0700
committerOri Bernstein <ori@eigenstate.org>2017-09-16 14:18:17 -0700
commit0eb2ad439e69e9576720badf1dca296c51db6e35 (patch)
treef3f12fa674f7f94739a6c2b27e19b7f8394fddb1
parent95a93936f420dd480454eb97c25b02874da7a966 (diff)
downloadmc-0eb2ad439e69e9576720badf1dca296c51db6e35.tar.gz
Fix occurs check.
Fixes bug #145. Thanks Milo (iitalics on github).
-rw-r--r--parse/infer.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse/infer.c b/parse/infer.c
index f03c6bc..83690cc 100644
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -353,6 +353,7 @@ occurs_rec(Type *sub, Bitset *bs)
{
size_t i;
+ sub = tf(sub);
if (bshas(bs, sub->tid))
return 1;
bsput(bs, sub->tid);
@@ -390,8 +391,9 @@ occursin(Type *a, Type *b)
int r;
bs = mkbs();
- bsput(bs, b->tid);
- r = occurs_rec(a, bs);
+ a = tf(a);
+ bsput(bs, a->tid);
+ r = occurs_rec(b, bs);
bsfree(bs);
return r;
}