diff options
Diffstat (limited to 'compiler/GHC/Tc/Errors')
-rw-r--r-- | compiler/GHC/Tc/Errors/Ppr.hs | 16 | ||||
-rw-r--r-- | compiler/GHC/Tc/Errors/Types.hs | 8 |
2 files changed, 24 insertions, 0 deletions
diff --git a/compiler/GHC/Tc/Errors/Ppr.hs b/compiler/GHC/Tc/Errors/Ppr.hs index 946b028e00..e70cd31db6 100644 --- a/compiler/GHC/Tc/Errors/Ppr.hs +++ b/compiler/GHC/Tc/Errors/Ppr.hs @@ -1238,6 +1238,18 @@ instance Diagnostic TcRnMessage where = vcat [ text "Starting from GHC 9.10, this warning will turn into an error." ] user_manual = vcat [ text "See the user manual, ยง Undecidable instances and loopy superclasses." ] + TcRnDefaultedExceptionContext ct_loc -> + mkSimpleDecorated $ vcat [ header, warning, proposal ] + where + header, warning, proposal :: SDoc + header + = vcat [ text "Solving for an implicit ExceptionContext constraint" + , nest 2 $ pprCtOrigin (ctLocOrigin ct_loc) <> text "." ] + warning + = vcat [ text "Future versions of GHC will turn this warning into an error." ] + proposal + = vcat [ text "See GHC Proposal #330." ] + diagnosticReason = \case TcRnUnknownMessage m @@ -1646,6 +1658,8 @@ instance Diagnostic TcRnMessage where -> ErrorWithoutFlag TcRnLoopySuperclassSolve{} -> WarningWithFlag Opt_WarnLoopySuperclassSolve + TcRnDefaultedExceptionContext{} + -> WarningWithoutFlag --WarningWithFlag TODO diagnosticHints = \case TcRnUnknownMessage m @@ -2064,6 +2078,8 @@ instance Diagnostic TcRnMessage where cls_or_qc = case ctLocOrigin wtd_loc of ScOrigin c_or_q _ -> c_or_q _ -> IsClsInst -- shouldn't happen + TcRnDefaultedExceptionContext _ + -> noHints diagnosticCode = constructorCode diff --git a/compiler/GHC/Tc/Errors/Types.hs b/compiler/GHC/Tc/Errors/Types.hs index f52dfe58c6..941bcdef8e 100644 --- a/compiler/GHC/Tc/Errors/Types.hs +++ b/compiler/GHC/Tc/Errors/Types.hs @@ -2793,6 +2793,14 @@ data TcRnMessage where -> PredType -- ^ Wanted 'PredType' -> TcRnMessage + {-| TcRnDefaultedExceptionContext is a warning that is triggered when the + backward-compatibility logic solving for implicit ExceptionContext + constraints fires. + + Test cases: TODO + -} + TcRnDefaultedExceptionContext :: CtLoc -> TcRnMessage + deriving Generic -- | Things forbidden in @type data@ declarations. |