summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/GHC/Tc/Solver/Rewrite.hs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/GHC/Tc/Solver/Rewrite.hs b/compiler/GHC/Tc/Solver/Rewrite.hs
index 76500f0519..6300215d2a 100644
--- a/compiler/GHC/Tc/Solver/Rewrite.hs
+++ b/compiler/GHC/Tc/Solver/Rewrite.hs
@@ -1017,10 +1017,13 @@ split_pi_tys' :: Type -> ([TyCoBinder], Type, Bool)
split_pi_tys' ty = split ty ty
where
-- put common cases first
- split _ (ForAllTy b res) = let (bs, ty, _) = split res res
+ split _ (ForAllTy b res) = let -- This bang is necessary lest we see rather
+ -- terrible reboxing, as noted in #19102.
+ !(bs, ty, _) = split res res
in (Named b : bs, ty, True)
split _ (FunTy { ft_af = af, ft_mult = w, ft_arg = arg, ft_res = res })
- = let (bs, ty, named) = split res res
+ = let -- See #19102
+ !(bs, ty, named) = split res res
in (Anon af (mkScaled w arg) : bs, ty, named)
split orig_ty ty | Just ty' <- coreView ty = split orig_ty ty'