summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorAlan Zimmerman <alan.zimm@gmail.com>2015-08-02 10:26:59 +0200
committerAlan Zimmerman <alan.zimm@gmail.com>2015-08-02 10:26:59 +0200
commit15dd7007275a5dcdae2c9f104773eceaa56590dc (patch)
tree9fe88a05942e8dc024e52d7f56830be3dae4899b /ghc
parent75504f300d4db33ff66cc1a572d473bdb23b6a42 (diff)
downloadhaskell-15dd7007275a5dcdae2c9f104773eceaa56590dc.tar.gz
Replace (SourceText,FastString) with StringLiteral data type
Summary: Phab:D907 introduced SourceText for a number of data types, by replacing FastString with (SourceText,FastString). Since this has an Outputable instance, no warnings are generated when ppr is called on it, but unexpected output is generated. See Phab:D1096 for an example of this. Replace the (SourceText,FastString) tuples with a new data type, ```lang=hs data StringLiteral = StringLiteral SourceText FastString ``` Update haddock submodule accordingly Test Plan: ./validate Reviewers: hvr, austin, rwbarton, trofi, bgamari Reviewed By: trofi, bgamari Subscribers: thomie, trofi, rwbarton, mpickering Differential Revision: https://phabricator.haskell.org/D1101 GHC Trac Issues: #10692
Diffstat (limited to 'ghc')
-rw-r--r--ghc/InteractiveUI.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index d834523cff..2dcedb0b0b 100644
--- a/ghc/InteractiveUI.hs
+++ b/ghc/InteractiveUI.hs
@@ -1580,7 +1580,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 (fmap snd $ ideclPkgQual d)
+ = do e <- gtry $ GHC.findModule mod_name (fmap sl_fs $ ideclPkgQual d)
case e :: Either SomeException Module of
Left _ -> return False
Right m -> return (not (isHomeModule m))
@@ -1756,7 +1756,7 @@ guessCurrentModule cmd
case (head imports) of
IIModule m -> GHC.findModule m Nothing
IIDecl d -> GHC.findModule (unLoc (ideclName d))
- (fmap snd $ ideclPkgQual d)
+ (fmap sl_fs $ ideclPkgQual d)
-- without bang, show items in context of their parents and omit children
-- with bang, show class methods and data constructors separately, and
@@ -1953,7 +1953,7 @@ checkAdd ii = do
IIDecl d -> do
let modname = unLoc (ideclName d)
pkgqual = ideclPkgQual d
- m <- GHC.lookupModule modname (fmap snd pkgqual)
+ m <- GHC.lookupModule modname (fmap sl_fs pkgqual)
when safe $ do
t <- GHC.isModuleTrusted m
when (not t) $ throwGhcException $ ProgramError $ ""