diff options
author | Alfredo Di Napoli <alfredo@well-typed.com> | 2021-04-20 11:03:01 +0200 |
---|---|---|
committer | Alfredo Di Napoli <alfredo@well-typed.com> | 2021-05-20 08:41:09 +0200 |
commit | 60b3ec36bfe1539cec62f28587c8bc4f04f78df5 (patch) | |
tree | aa32cb76d3ca30fa2a1cec4c428e63211d08bd62 /compiler/GHC/Tc/Module.hs | |
parent | 939a56e780b7cc55cf49b52c4222e0e8061e99b1 (diff) | |
download | haskell-wip/adinapoli-hints-design.tar.gz |
Extensible Hints for diagnostic messageswip/adinapoli-hints-design
This commit extends the GHC diagnostic hierarchy with a `GhcHint` type,
modelling helpful suggestions emitted by GHC which can be used to deal
with a particular warning or error.
As a direct consequence of this, the `Diagnostic` typeclass has been extended
with a `diagnosticHints` method, which returns a `[GhcHint]`. This means
that now we can clearly separate out the printing of the diagnostic
message with the suggested fixes.
This is done by extending the `printMessages` function in
`GHC.Driver.Errors`.
On top of that, the old `PsHint` type has been superseded by the new `GhcHint`
type, which de-duplicates some hints in favour of a general `SuggestExtension`
constructor that takes a `GHC.LanguageExtensions.Extension`.
Diffstat (limited to 'compiler/GHC/Tc/Module.hs')
-rw-r--r-- | compiler/GHC/Tc/Module.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/GHC/Tc/Module.hs b/compiler/GHC/Tc/Module.hs index 50b832ed49..450e97819a 100644 --- a/compiler/GHC/Tc/Module.hs +++ b/compiler/GHC/Tc/Module.hs @@ -214,7 +214,7 @@ tcRnModule hsc_env mod_sum save_rn_syntax logger = hsc_logger hsc_env home_unit = hsc_home_unit hsc_env err_msg = mkPlainErrorMsgEnvelope loc $ - TcRnUnknownMessage $ mkPlainError $ + TcRnUnknownMessage $ mkPlainError noHints $ text "Module does not have a RealSrcSpan:" <+> ppr this_mod pair :: (Module, SrcSpan) @@ -3152,5 +3152,5 @@ mark_plugin_unsafe dflags = unless (gopt Opt_PluginTrustworthy dflags) $ singleMessage $ mkPlainMsgEnvelope dflags noSrcSpan $ TcRnUnknownMessage $ - mkPlainDiagnostic WarningWithoutFlag $ + mkPlainDiagnostic WarningWithoutFlag noHints $ Outputable.text unsafeText |