summaryrefslogtreecommitdiff
path: root/compiler/utils/Binary.hs
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 /compiler/utils/Binary.hs
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 'compiler/utils/Binary.hs')
-rw-r--r--compiler/utils/Binary.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs
index f889a4c067..8f0d8e50dc 100644
--- a/compiler/utils/Binary.hs
+++ b/compiler/utils/Binary.hs
@@ -901,6 +901,15 @@ instance Binary WarningTxt where
d <- get bh
return (DeprecatedTxt s d)
+instance Binary StringLiteral where
+ put_ bh (StringLiteral st fs) = do
+ put_ bh st
+ put_ bh fs
+ get bh = do
+ st <- get bh
+ fs <- get bh
+ return (StringLiteral st fs)
+
instance Binary a => Binary (GenLocated SrcSpan a) where
put_ bh (L l x) = do
put_ bh l