Open shriram opened 6 years ago
Also, this version type-checks:
import lists as L
import equality as EQ
fun instantiate-please<A>(x :: A, y :: A) -> EQ.EqualityResult: identical3(x, y) end
fun sh(t :: Number, seen :: List<Number>) -> EQ.EqualityResult:
L.member-with(seen, t, instantiate-please)
end
so it seems like something odd in comparing instantiated type variables with Any
in constraints.
I can't understand why this program doesn't type-check:
The program runs without error: eg,
but the type-checker says that the
Number
constraint onseen
inside the function is inconsistent with theAny
constraint onidentical3
. I thought this was just becauseidentical3
had not been given a type, but that's not true: here's a simple program that type-checks fineand another that also exercises the return type:
so that can't really be it…