summaryrefslogtreecommitdiff
path: root/compiler/GHC/Types
diff options
context:
space:
mode:
authorTorsten Schmits <git@tryp.io>2023-04-26 21:56:16 +0200
committerTorsten Schmits <haskell-gitlab@schmits.me>2023-05-05 08:43:02 +0000
commit275836d211d119cb8786a91ca3108a4daa693cb2 (patch)
tree9dfc96c90e69cd97ba2e674407be8f30bf5ac26c /compiler/GHC/Types
parente8b72ff6e4aee1f889a9168df57bb1b00168fd21 (diff)
downloadhaskell-275836d211d119cb8786a91ca3108a4daa693cb2.tar.gz
Add structured error messages for GHC.Rename.Utils
Tracking ticket: #20115 MR: !10350 This converts uses of `mkTcRnUnknownMessage` to newly added constructors of `TcRnMessage`.
Diffstat (limited to 'compiler/GHC/Types')
-rw-r--r--compiler/GHC/Types/Error/Codes.hs12
-rw-r--r--compiler/GHC/Types/Hint.hs5
-rw-r--r--compiler/GHC/Types/Hint/Ppr.hs2
3 files changed, 19 insertions, 0 deletions
diff --git a/compiler/GHC/Types/Error/Codes.hs b/compiler/GHC/Types/Error/Codes.hs
index 46597c8e0c..cb80f713d4 100644
--- a/compiler/GHC/Types/Error/Codes.hs
+++ b/compiler/GHC/Types/Error/Codes.hs
@@ -586,6 +586,18 @@ type family GhcDiagnosticCode c = n | n -> c where
GhcDiagnosticCode "TcRnDuplicateDecls" = 29916
GhcDiagnosticCode "TcRnPackageImportsDisabled" = 10032
GhcDiagnosticCode "TcRnIllegalDataCon" = 78448
+ GhcDiagnosticCode "TcRnNestedForallsContexts" = 71492
+ GhcDiagnosticCode "TcRnRedundantRecordWildcard" = 15932
+ GhcDiagnosticCode "TcRnUnusedRecordWildcard" = 83475
+ GhcDiagnosticCode "TcRnUnusedName" = 40910
+ GhcDiagnosticCode "TcRnQualifiedBinder" = 28329
+ GhcDiagnosticCode "TcRnTypeApplicationsDisabled" = 23482
+ GhcDiagnosticCode "TcRnInvalidRecordField" = 53822
+ GhcDiagnosticCode "TcRnTupleTooLarge" = 94803
+ GhcDiagnosticCode "TcRnCTupleTooLarge" = 89347
+ GhcDiagnosticCode "TcRnIllegalInferredTyVars" = 54832
+ GhcDiagnosticCode "TcRnAmbiguousName" = 87543
+ GhcDiagnosticCode "TcRnBindingNameConflict" = 10498
-- PatSynInvalidRhsReason
GhcDiagnosticCode "PatSynNotInvertible" = 69317
diff --git a/compiler/GHC/Types/Hint.hs b/compiler/GHC/Types/Hint.hs
index 4ce8d04a9d..773ed4941d 100644
--- a/compiler/GHC/Types/Hint.hs
+++ b/compiler/GHC/Types/Hint.hs
@@ -434,6 +434,11 @@ data GhcHint
-}
| SuggestSafeHaskell
+ {-| Suggest removing a record wildcard from a pattern when it doesn't
+ bind anything useful.
+ -}
+ | SuggestRemoveRecordWildcard
+
-- | An 'InstantiationSuggestion' for a '.hsig' file. This is generated
-- by GHC in case of a 'DriverUnexpectedSignature' and suggests a way
-- to instantiate a particular signature, where the first argument is
diff --git a/compiler/GHC/Types/Hint/Ppr.hs b/compiler/GHC/Types/Hint/Ppr.hs
index c0945f29fe..76e678bb36 100644
--- a/compiler/GHC/Types/Hint/Ppr.hs
+++ b/compiler/GHC/Types/Hint/Ppr.hs
@@ -232,6 +232,8 @@ instance Outputable GhcHint where
pp_args = hsep (map ppr args)
SuggestSafeHaskell
-> text "Enable Safe Haskell through either Safe, Trustworthy or Unsafe."
+ SuggestRemoveRecordWildcard
+ -> text "Omit the" <+> quotes (text "..")
perhapsAsPat :: SDoc
perhapsAsPat = text "Perhaps you meant an as-pattern, which must not be surrounded by whitespace"