[commit: ghc] wip/T10071: WIP (a56a548)

git at git.haskell.org git at git.haskell.org
Mon Sep 28 06:54:50 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/T10071
Link       : http://ghc.haskell.org/trac/ghc/changeset/a56a548f9c0aec9162e486018d38493544e742fe/ghc

>---------------------------------------------------------------

commit a56a548f9c0aec9162e486018d38493544e742fe
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date:   Sat Jun 27 20:39:40 2015 +0200

    WIP


>---------------------------------------------------------------

a56a548f9c0aec9162e486018d38493544e742fe
 compiler/main/HscTypes.hs | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs
index 67b0694..6aa6122 100644
--- a/compiler/main/HscTypes.hs
+++ b/compiler/main/HscTypes.hs
@@ -1934,11 +1934,29 @@ but they are mostly elaborated elsewhere
 -}
 
 ------------------ Warnings -------------------------
+
+-- data WarnItem = WI OccName WarnInfo (Located SourceText) [Located (SourceText,FastString)]
+-- data WarnInfo = Warning | DeprecTop | DeprecMeth
+
+-- Some overlap w/ 'WarningTxt'
+data WarnItem = WarnItem OccName !WarnInfo (Located SourceText) [Located (SourceText,FastString)]
+              deriving Eq
+
+data WarnInfo
+  = Warning    -- top-level  indented
+  | DeprecTop  -- top-level  indented
+  | DeprecMeth -- class-body indented
+  deriving (Eq, Enum)
+
+instance Binary WarnInfo where
+    put_ bh wi = putByte bh (fromIntegral $ fromEnum wi)
+    get bh = toEnum . fromIntegral <$> getByte bh
+
 -- | Warning information for a module
 data Warnings
   = NoWarnings                          -- ^ Nothing deprecated
   | WarnAll WarningTxt                  -- ^ Whole module deprecated
-  | WarnSome [(OccName,WarningTxt)]     -- ^ Some specific things deprecated
+  | WarnSome [WarnInfo]                 -- ^ Some specific things deprecated
 
      -- Only an OccName is needed because
      --    (1) a deprecation always applies to a binding



More information about the ghc-commits mailing list