Commit 0c41a902 authored by Alexis King's avatar Alexis King

Revert change to typeclass instance head unification

This reverts a small portion of 8bb52d91
for the reasons given in #19052. This is a temporary workaround; whether
or not this is kept depends on the outcome of that discussion.
parent 3b7409bf
......@@ -835,12 +835,9 @@ lookupInstEnv' ie vis_mods cls tys
-- Unification will break badly if the variables overlap
-- They shouldn't because we allocate separate uniques for them
-- See Note [Template tyvars are fresh]
case tcUnifyTysFG instanceBindFun tpl_tys tys of
-- We consider MaybeApart to be a case where the instance might
-- apply in the future. This covers an instance like C Int and
-- a target like [W] C (F a), where F is a type family.
SurelyApart -> find ms us rest
_ -> find ms (item:us) rest
case tcUnifyTys instanceBindFun tpl_tys tys of
Just _ -> find ms (item:us) rest
Nothing -> find ms us rest
tpl_tv_set = mkVarSet tpl_tvs
tys_tv_set = tyCoVarsOfTypes tys
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment