Admin message

Due to a large amount of spam we do not allow new users to create repositories, they are "external" users. If you are a new user and want to create a repository, for example for forking GHC, open a new issue on ghc/ghc using the "get-verified" issue template

Convert UnknownTcRnMessage diagnostics into proper type constructors
This issue capitalises on the refactoring work done in #19930. Now GHC has a multitude of TcRn errors and warnings constructed by using the `TcRnUnknownMessage` type constructor from `GHC.Tc.Errors.Types`, which simply wraps an `SDoc`. This ticket is about grepping the codebase for all these diagnostics and convert as many of them into proper type constructors in `TcRnMessage`. ## Practical example We currently have in `GHC.Rename.Pat.rnConPatAndThen`: ```hs check_lang_exts :: RnM () check_lang_exts = do scoped_tyvars <- xoptM LangExt.ScopedTypeVariables type_app <- xoptM LangExt.TypeApplications unless (scoped_tyvars && type_app) $ case listToMaybe tyargs of Nothing -> pure () Just tyarg -> addErr $ TcRnUnknownMessage $ mkPlainError noHints $ hang (text "Illegal visible type application in a pattern:" <+> quotes (char '@' <> ppr tyarg)) 2 (text "Both ScopedTypeVariables and TypeApplications are" <+> text "required to use this feature") ``` This should be converted into a new type constructor for `TcRnMessage` like: ```hs ... | TcRnIllegalVisTyAppInPat (HsPatSigType (NoGhcTc GhcPs)) ``` And later give this a proper implementation for the `diagnosticMessage` and `diagnosticHints`, so that we can refactor `check_lang_exts` to be: ```hs check_lang_exts :: RnM () check_lang_exts = do scoped_tyvars <- xoptM LangExt.ScopedTypeVariables type_app <- xoptM LangExt.TypeApplications unless (scoped_tyvars && type_app) $ case listToMaybe tyargs of Nothing -> pure () Just tyarg -> addErr $ TcRnIllegalVisTyAppInPat tyarg ``` On the hint front, it looks like this might warrant a new type of hint (or a modification of `SuggestExtension`) that suggests a _set_ of extensions rather than just one.
issue