summaryrefslogtreecommitdiff
path: root/compiler/GHC/Tc/Errors/Ppr.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Tc/Errors/Ppr.hs')
-rw-r--r--compiler/GHC/Tc/Errors/Ppr.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/GHC/Tc/Errors/Ppr.hs b/compiler/GHC/Tc/Errors/Ppr.hs
index bf92125405..a9b1084914 100644
--- a/compiler/GHC/Tc/Errors/Ppr.hs
+++ b/compiler/GHC/Tc/Errors/Ppr.hs
@@ -1338,6 +1338,9 @@ instance Diagnostic TcRnMessage where
TcRnSectionWithoutParentheses expr -> mkSimpleDecorated $
hang (text "A section must be enclosed in parentheses")
2 (text "thus:" <+> (parens (ppr expr)))
+ TcRnMissingRoleAnnotation name roles -> mkSimpleDecorated $
+ hang (text "Missing role annotation" <> colon)
+ 2 (text "type role" <+> ppr name <+> hsep (map ppr roles))
TcRnCapturedTermName tv_name shadowed_term_names
-> mkSimpleDecorated $
@@ -2547,6 +2550,8 @@ instance Diagnostic TcRnMessage where
-> ErrorWithoutFlag
TcRnGhciMonadLookupFail {}
-> ErrorWithoutFlag
+ TcRnMissingRoleAnnotation{}
+ -> WarningWithFlag Opt_WarnMissingRoleAnnotations
diagnosticHints = \case
TcRnUnknownMessage m
@@ -3226,6 +3231,8 @@ instance Diagnostic TcRnMessage where
-> noHints
TcRnGhciMonadLookupFail {}
-> noHints
+ TcRnMissingRoleAnnotation{}
+ -> noHints
diagnosticCode :: TcRnMessage -> Maybe DiagnosticCode
diagnosticCode = constructorCode