summaryrefslogtreecommitdiff
path: root/compiler/GHC/Parser/Header.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Parser/Header.hs')
-rw-r--r--compiler/GHC/Parser/Header.hs9
1 files changed, 3 insertions, 6 deletions
diff --git a/compiler/GHC/Parser/Header.hs b/compiler/GHC/Parser/Header.hs
index 52a98d86dc..daa8bc78a5 100644
--- a/compiler/GHC/Parser/Header.hs
+++ b/compiler/GHC/Parser/Header.hs
@@ -30,8 +30,6 @@ import GHC.Driver.Config
import GHC.Driver.Errors.Types -- Unfortunate, needed due to the fact we throw exceptions!
import GHC.Parser.Errors.Types
-import GHC.Parser.Errors.Ppr
-import GHC.Parser.Errors
import GHC.Parser ( parseHeader )
import GHC.Parser.Lexer
@@ -53,7 +51,6 @@ import GHC.Utils.Exception as Exception
import GHC.Data.StringBuffer
import GHC.Data.Maybe
-import GHC.Data.Bag (Bag, isEmptyBag )
import GHC.Data.FastString
import qualified GHC.Data.Strict as Strict
@@ -79,7 +76,7 @@ getImports :: ParserOpts -- ^ Parser options
-> FilePath -- ^ The original source filename (used for locations
-- in the function result)
-> IO (Either
- (Bag PsError)
+ (Messages PsMessage)
([(Maybe FastString, Located ModuleName)],
[(Maybe FastString, Located ModuleName)],
Located ModuleName))
@@ -95,8 +92,8 @@ getImports popts implicit_prelude buf filename source_filename = do
let (_warns, errs) = getMessages pst
-- don't log warnings: they'll be reported when we parse the file
-- for real. See #2500.
- if not (isEmptyBag errs)
- then throwErrors $ foldPsMessages mkParserErr errs
+ if not (isEmptyMessages errs)
+ then throwErrors (GhcPsMessage <$> errs)
else
let hsmod = unLoc rdr_module
mb_mod = hsmodName hsmod