diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2020-10-19 16:52:47 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2020-10-23 09:29:01 +0100 |
commit | 824962f4fdd713fe45d5899485549c006605acdf (patch) | |
tree | a7847c04fa263d3374f6008681d76ad751dfdb85 /compiler/GHC/Core/Unify.hs | |
parent | 730bb59086ad1036143983c3fba61bd851bebc03 (diff) | |
download | haskell-wip/T18855.tar.gz |
Fix two constraint solving problemswip/T18855
This patch fixes two problems in the constraint solver.
* An actual bug #18555: we were floating out a constraint to eagerly,
and that was ultimately fatal. It's explained in
Note [Do not float blocked constraints] in GHC.Core.Constraint.
This is all very delicate, but it's all going to become irrelevant
when we stop floating constraints (#17656).
* A major performance infelicity in the flattener. When flattening
(ty |> co) we *never* generated Refl, even when there was nothing
at all to do. Result: we would gratuitously rewrite the constraint
to exactly the same thing, wasting work. Described in #18413, and
came up again in #18855.
Solution: exploit the special case by calling the new function
castCoercionKind1. See Note [castCoercionKind1] in
GHC.Core.Coercion
Diffstat (limited to 'compiler/GHC/Core/Unify.hs')
-rw-r--r-- | compiler/GHC/Core/Unify.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Core/Unify.hs b/compiler/GHC/Core/Unify.hs index 37b30629d5..0bbc844189 100644 --- a/compiler/GHC/Core/Unify.hs +++ b/compiler/GHC/Core/Unify.hs @@ -1454,7 +1454,7 @@ ty_co_match menv subst (TyVarTy tv1) co lkco rkco = if any (inRnEnvR rn_env) (tyCoVarsOfCoList co) then Nothing -- occurs check failed else Just $ extendVarEnv subst tv1' $ - castCoercionKindI co (mkSymCo lkco) (mkSymCo rkco) + castCoercionKind co (mkSymCo lkco) (mkSymCo rkco) | otherwise = Nothing |