Skip to content

Commit ab24169

Browse files
contra
1 parent 677129a commit ab24169

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
CC = cc
22

33
dev: install-production
4-
lm tests/regress/numerical-pyramid.lsts
4+
lm tests/unit/type-inference.lsts
55
$(CC) -O3 tmp.c
66
./a.out
77
#lm tests/c/main.c

SRC/can-unify.lsts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ let can-unify(fpt: Type, pt: Type): U64 = (
6767
second:rp1
6868
} => can-unify(lp1,rp1);
6969

70+
Tuple{
71+
first:TGround{tag:c"Arrow", parameters:[lrng.. ldom..]},
72+
second:TGround{tag:c"Arrow", parameters:[rrng.. rdom..]}
73+
} => can-unify(rdom, ldom) && can-unify(ldom, rdom);
74+
7075
Tuple{
7176
first:TGround{ltn=tag, lps=parameters},
7277
second:TGround{rtn=tag, rps=parameters}

tests/unit/type-inference.lsts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,10 @@ if true {
3434
let tctx = unify(t-array-x, t-array-A-d);
3535
assert( substitute(tctx, t-x) == t-A );
3636
};
37+
38+
let t-f1 = normalize(t3(c"Arrow", t-A, t-A));
39+
let t-f2 = normalize(t3(c"Arrow", t-C, t-A));
40+
let t-f3 = normalize(t3(c"Arrow", t-A, t-C));
41+
42+
assert( not(can-unify(t-f2, t-f1)) );
43+
assert( can-unify(t-f3, t-f1) );

0 commit comments

Comments
 (0)