summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Errors
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-10-18 13:40:23 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-20 14:07:49 -0400
commit05b8a21884fb3b283acb7d148afc875a95f7752c (patch)
treed41b6dcdb9ef529593ab45d3c1e8d82c5db847d0 /compiler/GHC/Tc/Errors
parentef92d88928651fa21b3b23d054f8a97d7b6104cd (diff)
downloadhaskell-05b8a21884fb3b283acb7d148afc875a95f7752c.tar.gz
Make fields of GlobalRdrElt strict
In order to do this I thought it was prudent to change the list type to a bag type to avoid doing a lot of premature work in plusGRE because of ++. Fixes #19201
Diffstat (limited to 'compiler/GHC/Tc/Errors')
-rw-r--r--compiler/GHC/Tc/Errors/Hole/FitTypes.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/GHC/Tc/Errors/Hole/FitTypes.hs b/compiler/GHC/Tc/Errors/Hole/FitTypes.hs
index 9c00c23cd1..70a655db45 100644
--- a/compiler/GHC/Tc/Errors/Hole/FitTypes.hs
+++ b/compiler/GHC/Tc/Errors/Hole/FitTypes.hs
@@ -42,7 +42,12 @@ instance Outputable TypedHole where
data HoleFitCandidate = IdHFCand Id -- An id, like locals.
| NameHFCand Name -- A name, like built-in syntax.
| GreHFCand GlobalRdrElt -- A global, like imported ids.
- deriving (Eq)
+
+instance Eq HoleFitCandidate where
+ IdHFCand i1 == IdHFCand i2 = i1 == i2
+ NameHFCand n1 == NameHFCand n2 = n1 == n2
+ GreHFCand gre1 == GreHFCand gre2 = gre_name gre1 == gre_name gre2
+ _ == _ = False
instance Outputable HoleFitCandidate where
ppr = pprHoleFitCand