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
committerMatthew Pickering <matthewtpickering@gmail.com>2022-06-15 17:06:44 +0100
commit1eba76f5f5511b63fb7585fde001506f9aaf24f6 (patch)
treef4b327019ac370bffb95ae317edd0cc03c2a26a3 /compiler/GHC/Core/Coercion.hs
parent486f43202c8be8eaea8b54c6bac7e9238aaf9b39 (diff)
downloadhaskell-1eba76f5f5511b63fb7585fde001506f9aaf24f6.tar.gz
Fix bad interaction between withDict and the Specialiser
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. (cherry picked from commit d2284c4c9dd484a4b459366956c4aedc72336b04)
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 4cfdc3ee82..f631932671 100644
--- a/compiler/GHC/Core/Coercion.hs
+++ b/compiler/GHC/Core/Coercion.hs
@@ -1707,9 +1707,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)