summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2015-06-01 14:16:41 +0200
committerAlan Zimmerman <alan.zimm@gmail.com>2015-06-01 14:16:41 +0200
commite6191d1cc37e98785af8b309100ea840084fa3ba (patch)
tree94af94a1d98cf4bd5f7efd8bfc5d9696d3b02821 /ghc
parent7dd0ea7428379df848e3d13528921b39b7bf5b95 (diff)
downloadhaskell-e6191d1cc37e98785af8b309100ea840084fa3ba.tar.gz
ApiAnnotations : strings in warnings do not return SourceText
Summary: The strings used in a WARNING pragma are captured via strings :: { Located ([AddAnn],[Located FastString]) } : STRING { sL1 $1 ([],[L (gl $1) (getSTRING $1)]) } .. The STRING token has a method getSTRINGs that returns the original source text for a string. A warning of the form {-# WARNING Logic , mkSolver , mkSimpleSolver , mkSolverForLogic , solverSetParams , solverPush , solverPop , solverReset , solverGetNumScopes , solverAssertCnstr , solverAssertAndTrack , solverCheck , solverCheckAndGetModel , solverGetReasonUnknown "New Z3 API support is still incomplete and fragile: \ \you may experience segmentation faults!" #-} returns the concatenated warning string rather than the original source. This patch now deals with all remaining instances of getSTRING to bring in a SourceText for each. This updates the haddock submodule as well, for the AST change. Test Plan: ./validate Reviewers: hvr, austin, goldfire Reviewed By: austin Subscribers: bgamari, thomie, mpickering Differential Revision: https://phabricator.haskell.org/D907 GHC Trac Issues: #10313
Diffstat (limited to 'ghc')
-rw-r--r--ghc/InteractiveUI.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index d3b4368478..d2940fa88a 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -1534,7 +1534,7 @@ keepPackageImports = filterM is_pkg_import
is_pkg_import :: InteractiveImport -> GHCi Bool
is_pkg_import (IIModule _) = return False
is_pkg_import (IIDecl d)
- = do e <- gtry $ GHC.findModule mod_name (ideclPkgQual d)
+ = do e <- gtry $ GHC.findModule mod_name (fmap snd $ ideclPkgQual d)
case e :: Either SomeException Module of
Left _ -> return False
Right m -> return (not (isHomeModule m))
@@ -1709,7 +1709,8 @@ guessCurrentModule cmd
CmdLineError (':' : cmd ++ ": no current module")
case (head imports) of
IIModule m -> GHC.findModule m Nothing
- IIDecl d -> GHC.findModule (unLoc (ideclName d)) (ideclPkgQual d)
+ IIDecl d -> GHC.findModule (unLoc (ideclName d))
+ (fmap snd $ ideclPkgQual d)
-- without bang, show items in context of their parents and omit children
-- with bang, show class methods and data constructors separately, and
@@ -1906,7 +1907,7 @@ checkAdd ii = do
IIDecl d -> do
let modname = unLoc (ideclName d)
pkgqual = ideclPkgQual d
- m <- GHC.lookupModule modname pkgqual
+ m <- GHC.lookupModule modname (fmap snd pkgqual)
when safe $ do
t <- GHC.isModuleTrusted m
when (not t) $ throwGhcException $ ProgramError $ ""