Make template-haskell build with GHC 7.6, fixes bootstrap build.
authorEdward Z. Yang <ezyang@cs.stanford.edu>
Mon, 11 May 2015 22:48:35 +0000 (15:48 -0700)
committerEdward Z. Yang <ezyang@cs.stanford.edu>
Tue, 12 May 2015 04:35:42 +0000 (21:35 -0700)
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate on 7.6

Reviewers: austin, goldfire

Subscribers: bgamari, thomie

Differential Revision: https://phabricator.haskell.org/D885

libraries/template-haskell/Language/Haskell/TH/Syntax.hs
libraries/template-haskell/template-haskell.cabal
mk/warnings.mk

index 8879c62..a6f970d 100644 (file)
@@ -1,5 +1,12 @@
 {-# LANGUAGE CPP, DeriveDataTypeable, PolymorphicComponents,
 {-# LANGUAGE CPP, DeriveDataTypeable, PolymorphicComponents,
-             RoleAnnotations, DeriveGeneric, FlexibleInstances #-}
+             DeriveGeneric, FlexibleInstances #-}
+
+#if __GLASGOW_HASKELL__ >= 707
+{-# LANGUAGE RoleAnnotations #-}
+{-# OPTIONS_GHC -fno-warn-inline-rule-shadowing #-}
+#else
+{-# OPTIONS_GHC -w #-} -- -fno-warn-inline-rule-shadowing doesn't exist
+#endif
 
 #if MIN_VERSION_base(4,8,0)
 #define HAS_NATURAL
 
 #if MIN_VERSION_base(4,8,0)
 #define HAS_NATURAL
@@ -170,7 +177,9 @@ instance Applicative Q where
 --
 -----------------------------------------------------
 
 --
 -----------------------------------------------------
 
+#if __GLASGOW_HASKELL__ >= 707
 type role TExp nominal   -- See Note [Role of TExp]
 type role TExp nominal   -- See Note [Role of TExp]
+#endif
 newtype TExp a = TExp { unType :: Exp }
 
 unTypeQ :: Q (TExp a) -> Q Exp
 newtype TExp a = TExp { unType :: Exp }
 
 unTypeQ :: Q (TExp a) -> Q Exp
index bd277d1..de71132 100644 (file)
@@ -31,7 +31,6 @@ Library
         MagicHash
         PolymorphicComponents
         RankNTypes
         MagicHash
         PolymorphicComponents
         RankNTypes
-        RoleAnnotations
         ScopedTypeVariables
         TemplateHaskell
         UnboxedTuples
         ScopedTypeVariables
         TemplateHaskell
         UnboxedTuples
@@ -48,7 +47,7 @@ Library
         Language.Haskell.TH.Lib.Map
 
     build-depends:
         Language.Haskell.TH.Lib.Map
 
     build-depends:
-        base       >= 4.7 && < 4.9,
+        base       >= 4.6 && < 4.9,
         pretty     == 1.1.*
 
     -- We need to set the package key to template-haskell (without a
         pretty     == 1.1.*
 
     -- We need to set the package key to template-haskell (without a
index 5c41d5f..22acf9a 100644 (file)
@@ -101,10 +101,6 @@ libraries/base_dist-install_EXTRA_HC_OPTS += -fno-warn-trustworthy-safe
 libraries/ghc-prim_dist-install_EXTRA_HC_OPTS += -fno-warn-trustworthy-safe
 libraries/Win32_dist-install_EXTRA_HC_OPTS += -fno-warn-trustworthy-safe
 
 libraries/ghc-prim_dist-install_EXTRA_HC_OPTS += -fno-warn-trustworthy-safe
 libraries/Win32_dist-install_EXTRA_HC_OPTS += -fno-warn-trustworthy-safe
 
-# Temporarely disable inline rule shadowing warning
-libraries/template-haskell_dist-boot_EXTRA_HC_OPTS += -fno-warn-inline-rule-shadowing
-libraries/template-haskell_dist-install_EXTRA_HC_OPTS += -fno-warn-inline-rule-shadowing
-
 # We need -fno-warn-deprecated-flags to avoid failure with -Werror
 GhcLibExtraHcOpts += -fno-warn-deprecated-flags
 GhcBootLibExtraHcOpts += -fno-warn-deprecated-flags
 # We need -fno-warn-deprecated-flags to avoid failure with -Werror
 GhcLibExtraHcOpts += -fno-warn-deprecated-flags
 GhcBootLibExtraHcOpts += -fno-warn-deprecated-flags