Use tcEqType in GHC.Core.Unify.uVar
Because uVar
used eqType
instead of tcEqType
, it was possible to accumulate a substitution that unified Type
and Constraint
.
For example, a call to tc_unify_tys
with arguments
tys1 = [ k, k ]
tys2 = [ Type, Constraint ]
would first add k = Type
to the substitution. That's fine, but then the second call to uVar
would claim that the substitution also unifies k
with Constraint
.
As we saw in #20521 (closed), this can be used to cause trouble.
Edited by sheaf