diff options
author | Richard Eisenberg <rae@richarde.dev> | 2021-11-04 16:14:46 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-11-12 21:21:27 -0500 |
commit | ca90ffa321a31842a32be1b5b6e26743cd677ec5 (patch) | |
tree | 3646cec962d499aa023140cc9a0999c0b9b61901 /compiler/GHC/Tc/Errors.hs | |
parent | 265ead8a7401e20d75ed4e476805508ea695f37f (diff) | |
download | haskell-ca90ffa321a31842a32be1b5b6e26743cd677ec5.tar.gz |
Use local instances with least superclass depth
See new Note [Use only the best local instance] in
GHC.Tc.Solver.Interact.
This commit also refactors the InstSC/OtherSC mechanism
slightly.
Close #20582.
Diffstat (limited to 'compiler/GHC/Tc/Errors.hs')
-rw-r--r-- | compiler/GHC/Tc/Errors.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/GHC/Tc/Errors.hs b/compiler/GHC/Tc/Errors.hs index 7177f7347f..6a6ccecf20 100644 --- a/compiler/GHC/Tc/Errors.hs +++ b/compiler/GHC/Tc/Errors.hs @@ -1028,11 +1028,11 @@ tryReporter ctxt (str, keep_me, suppress_after, reporter) cts pprArising :: CtOrigin -> SDoc -- Used for the main, top-level error message --- We've done special processing for TypeEq, KindEq, Given -pprArising (TypeEqOrigin {}) = empty -pprArising (KindEqOrigin {}) = empty -pprArising (GivenOrigin {}) = empty -pprArising orig = pprCtOrigin orig +-- We've done special processing for TypeEq, KindEq, givens +pprArising (TypeEqOrigin {}) = empty +pprArising (KindEqOrigin {}) = empty +pprArising orig | isGivenOrigin orig = empty + | otherwise = pprCtOrigin orig -- Add the "arising from..." part to a message about bunch of dicts addArising :: CtOrigin -> SDoc -> SDoc |