diff options
author | sheaf <sam.derbyshire@gmail.com> | 2021-08-14 03:41:03 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-08-15 09:00:29 -0400 |
commit | 1e896b476086e83ed6e97fb9d0ba8b96fed07783 (patch) | |
tree | 9f55f42c4630878ed94f31ffefa0f8026da8e2b6 /compiler/GHC/Tc/Errors.hs | |
parent | a975583c70e57434340d9a20c976c8f06fde9beb (diff) | |
download | haskell-1e896b476086e83ed6e97fb9d0ba8b96fed07783.tar.gz |
Detect TypeError when checking for insolubility
We detect insoluble Givens by making getInertInsols
take into account TypeError constraints, on top of insoluble equalities
such as Int ~ Bool (which it already took into account).
This allows pattern matches with insoluble contexts to be reported
as redundant (tyOracle calls tcCheckGivens which calls getInertInsols).
As a bonus, we get to remove a workaround in Data.Typeable.Internal:
we can directly use a NotApplication type family, as opposed to
needing to cook up an insoluble equality constraint.
Fixes #11503 #14141 #16377 #20180
Diffstat (limited to 'compiler/GHC/Tc/Errors.hs')
-rw-r--r-- | compiler/GHC/Tc/Errors.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Tc/Errors.hs b/compiler/GHC/Tc/Errors.hs index dc95a6a81d..51ab0fca2a 100644 --- a/compiler/GHC/Tc/Errors.hs +++ b/compiler/GHC/Tc/Errors.hs @@ -583,7 +583,7 @@ reportWanteds ctxt tc_lvl (WC { wc_simple = simples, wc_impl = implics -- report1: ones that should *not* be suppressed by -- an insoluble somewhere else in the tree -- It's crucial that anything that is considered insoluble - -- (see GHC.Tc.Utils.insolubleCt) is caught here, otherwise + -- (see GHC.Tc.Utils.insolublWantedCt) is caught here, otherwise -- we might suppress its error message, and proceed on past -- type checking to get a Lint error later report1 = [ ("custom_error", unblocked is_user_type_error, True, mkUserTypeErrorReporter) |