summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/Coercion.hs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2022-05-16 13:33:12 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2022-05-16 14:14:13 +0100
commit93a8f26c29ccb220ce12f0087eb464920097e128 (patch)
treed9f37f02373a17d534baed098f73eacb94cfc210 /compiler/GHC/Core/Coercion.hs
parentaed356e1b68b2201fa6e3c5bf14079f3f3366b44 (diff)
downloadhaskell-wip/T21575.tar.gz
Fix bad interaction between withDict and the Specialiserwip/T21575
This MR fixes a bad bug, where the withDict was inlined too vigorously, which in turn made the type-class Specialiser generate a bogus specialisation, because it saw the same overloaded function applied to two /different/ dictionaries. Solution: inline `withDict` later. See (WD8) of Note [withDict] in GHC.HsToCore.Expr See #21575, which is fixed by this change.
Diffstat (limited to 'compiler/GHC/Core/Coercion.hs')
-rw-r--r--compiler/GHC/Core/Coercion.hs5
1 files changed, 2 insertions, 3 deletions
diff --git a/compiler/GHC/Core/Coercion.hs b/compiler/GHC/Core/Coercion.hs
index 235e8c65fb..98aa337026 100644
--- a/compiler/GHC/Core/Coercion.hs
+++ b/compiler/GHC/Core/Coercion.hs
@@ -1708,9 +1708,8 @@ has to do in its full generality. See #18413.
%************************************************************************
-}
--- | If @co :: T ts ~ rep_ty@ then:
---
--- > instNewTyCon_maybe T ts = Just (rep_ty, co)
+-- | If `instNewTyCon_maybe T ts = Just (rep_ty, co)`
+-- then `co :: T ts ~R# rep_ty`
--
-- Checks for a newtype, and for being saturated
instNewTyCon_maybe :: TyCon -> [Type] -> Maybe (Type, Coercion)