Change WarningWithFlag to plural WarningWithFlags
Resolves #22825 Now each diagnostic can name multiple different warning flags for its reason. There is currently one use case: missing signatures. Currently we need to check which warning flags are enabled when generating the diagnostic, which is against the declarative nature of the diagnostic framework. This patch allows a warning diagnostic to have multiple warning flags, which makes setup more declarative. The WarningWithFlag pattern synonym is added for backwards compatibility The 'msgEnvReason' field is added to MsgEnvelope to store the `ResolvedDiagnosticReason`, which accounts for the enabled flags, and then that is used for pretty printing the diagnostic.
Showing
- compiler/GHC/Driver/Errors.hs 2 additions, 1 deletioncompiler/GHC/Driver/Errors.hs
- compiler/GHC/Rename/Names.hs 4 additions, 6 deletionscompiler/GHC/Rename/Names.hs
- compiler/GHC/Tc/Errors/Ppr.hs 16 additions, 19 deletionscompiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs 1 addition, 2 deletionscompiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Types/Error.hs 76 additions, 11 deletionscompiler/GHC/Types/Error.hs
- compiler/GHC/Utils/Error.hs 45 additions, 21 deletionscompiler/GHC/Utils/Error.hs
- testsuite/tests/plugins/T20803-plugin/AddErrorPlugin.hs 5 additions, 6 deletionstestsuite/tests/plugins/T20803-plugin/AddErrorPlugin.hs
Loading
Please register or sign in to comment