summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Errors/Ppr.hs
diff options
context:
space:
mode:
authorAlfredo Di Napoli <alfredo@well-typed.com>2021-07-06 09:56:45 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-07-09 08:46:44 -0400
commit558724237b978ab2293a62ee48fe2b2f603a6791 (patch)
tree4d8c615cf09af0de214f26ffed88f55593c98ed6 /compiler/GHC/Tc/Errors/Ppr.hs
parent573012c7be49e24ec09a88e078fd22f62f9a4b1d (diff)
downloadhaskell-558724237b978ab2293a62ee48fe2b2f603a6791.tar.gz
Add the TcRnDuplicateWarningDecls to TcRnMessage
Diffstat (limited to 'compiler/GHC/Tc/Errors/Ppr.hs')
-rw-r--r--compiler/GHC/Tc/Errors/Ppr.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/GHC/Tc/Errors/Ppr.hs b/compiler/GHC/Tc/Errors/Ppr.hs
index 727edc78cd..9953971c24 100644
--- a/compiler/GHC/Tc/Errors/Ppr.hs
+++ b/compiler/GHC/Tc/Errors/Ppr.hs
@@ -58,6 +58,10 @@ instance Diagnostic TcRnMessage where
sep [text "This binding for" <+> quotes (ppr occ)
<+> text "shadows the existing binding" <> plural shadowed_locs,
nest 2 (vcat shadowed_locs)]
+ TcRnDuplicateWarningDecls d rdr_name
+ -> mkSimpleDecorated $
+ vcat [text "Multiple warning declarations for" <+> quotes (ppr rdr_name),
+ text "also at " <+> ppr (getLocA d)]
diagnosticReason = \case
TcRnUnknownMessage m
@@ -83,6 +87,8 @@ instance Diagnostic TcRnMessage where
-> ErrorWithoutFlag
TcRnShadowedName{}
-> WarningWithFlag Opt_WarnNameShadowing
+ TcRnDuplicateWarningDecls{}
+ -> ErrorWithoutFlag
diagnosticHints = \case
TcRnUnknownMessage m
@@ -108,6 +114,8 @@ instance Diagnostic TcRnMessage where
-> noHints
TcRnShadowedName{}
-> noHints
+ TcRnDuplicateWarningDecls{}
+ -> noHints
messageWithInfoDiagnosticMessage :: UnitState
-> ErrInfo