diff options
author | Alfredo Di Napoli <alfredo@well-typed.com> | 2021-04-13 10:26:42 +0200 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-05-05 05:43:14 -0400 |
commit | 101d25fce311237b82580745c321f70e62755719 (patch) | |
tree | ed415411f552d65b3fa42a407199f555bf2a302b /compiler/GHC.hs | |
parent | 958c6fbdc7ba76313f6f6d110f5a0ee2474d26b6 (diff) | |
download | haskell-101d25fce311237b82580745c321f70e62755719.tar.gz |
Add some DriverMessage type constructors
This commit expands the DriverMessage type with new type constructors,
making the number of diagnostics GHC can emit richer. In particular:
* Add DriverMissingHomeModules message
* Add DriverUnusedPackage message
* Add DriverUnnecessarySourceImports message
This commit adds the `DriverUnnecessarySourceImports` message and
fixes a small bug in its reporting: inside
`warnUnnecessarySourceImports` we were checking for
`Opt_WarnUnusedSourceImports` to be set, but we were emitting the
diagnostic with `WarningWithoutFlag`. This also adjusts the T10637 test to reflect that.
* Add DriverDuplicatedModuleDeclaration message
* Add DriverModuleNotFound message
* Add DriverFileModuleNameMismatch message
* Add DriverUnexpectedSignature message
* Add DriverFileNotFound message
* Add DriverStaticPointersNotSupported message
* Add DriverBackpackModuleNotFound message
Diffstat (limited to 'compiler/GHC.hs')
-rw-r--r-- | compiler/GHC.hs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/GHC.hs b/compiler/GHC.hs index 2a75c2b840..9f64e5b02c 100644 --- a/compiler/GHC.hs +++ b/compiler/GHC.hs @@ -310,7 +310,6 @@ import GHC.Driver.Errors import GHC.Driver.Errors.Types import GHC.Driver.CmdLine import GHC.Driver.Session -import qualified GHC.Driver.Session as Session import GHC.Driver.Backend import GHC.Driver.Config import GHC.Driver.Main @@ -913,10 +912,8 @@ checkNewInteractiveDynFlags logger dflags0 = do -- the REPL. See #12356. if xopt LangExt.StaticPointers dflags0 then do liftIO $ printOrThrowDiagnostics logger dflags0 $ singleMessage - $ mkPlainMsgEnvelope dflags0 interactiveSrcSpan - $ GhcDriverMessage $ DriverUnknownMessage - $ mkPlainDiagnostic Session.WarningWithoutFlag - $ text "StaticPointers is not supported in GHCi interactive expressions." + $ fmap GhcDriverMessage + $ mkPlainMsgEnvelope dflags0 interactiveSrcSpan DriverStaticPointersNotSupported return $ xopt_unset dflags0 LangExt.StaticPointers else return dflags0 |