summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2015-06-27 20:39:40 +0200
committerHerbert Valerio Riedel <hvr@gnu.org>2015-06-27 20:39:40 +0200
commita56a548f9c0aec9162e486018d38493544e742fe (patch)
treedbfa478acd34a2b05cc07db98601e834a7cca115
parent9776dc838e1fc7ce27d3db0a0d893555ea6487db (diff)
downloadhaskell-wip/T10071.tar.gz
-rw-r--r--compiler/main/HscTypes.hs20
1 files changed, 19 insertions, 1 deletions
diff --git a/compiler/main/HscTypes.hs b/compiler/main/HscTypes.hs
index 67b069470b..6aa6122f95 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