summaryrefslogtreecommitdiff
path: root/testsuite/tests/patsyn/should_compile
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2018-10-15 13:52:12 -0400
committerBen Gamari <ben@smart-cactus.org>2018-10-15 19:24:16 -0400
commit165d3d5ddaecc7dbe7f5ac051834a7619463efb0 (patch)
tree6ae7967d95ddc071a6dda7e3307f4a16cbf2229f /testsuite/tests/patsyn/should_compile
parent058c2813d882266309e8045af7a72eedecbf2dbb (diff)
downloadhaskell-165d3d5ddaecc7dbe7f5ac051834a7619463efb0.tar.gz
Enable -Wcompat=error in the testsuite
Enabling -Werror=compat in the testsuite allows us to easily see the impact that a new warning has on code. It also means that in the period between adding the warning and making the actual breaking change, all new test cases that are being added to the testsuite will be forwards-compatible. This is good because it will make the actual breaking change contain less irrelevant testsuite updates. Things that -Wcompat warns about are things that are going to break in the future, so we can be proactive and keep our testsuite forwards-compatible. This patch consists of two main changes: * Add `TEST_HC_OPTS += -Werror=compat` to the testsuite configuration. * Fix all broken test cases. Test Plan: Validate Reviewers: hvr, goldfire, bgamari, simonpj, RyanGlScott Reviewed By: goldfire, RyanGlScott Subscribers: rwbarton, carter GHC Trac Issues: #15278 Differential Revision: https://phabricator.haskell.org/D5200
Diffstat (limited to 'testsuite/tests/patsyn/should_compile')
-rw-r--r--testsuite/tests/patsyn/should_compile/T10997_1a.hs6
-rw-r--r--testsuite/tests/patsyn/should_compile/T12968.hs3
-rw-r--r--testsuite/tests/patsyn/should_compile/T8966.hs4
-rw-r--r--testsuite/tests/patsyn/should_compile/T8968-1.hs4
-rw-r--r--testsuite/tests/patsyn/should_compile/T8968-2.hs4
5 files changed, 14 insertions, 7 deletions
diff --git a/testsuite/tests/patsyn/should_compile/T10997_1a.hs b/testsuite/tests/patsyn/should_compile/T10997_1a.hs
index f6a292aa54..11af525c53 100644
--- a/testsuite/tests/patsyn/should_compile/T10997_1a.hs
+++ b/testsuite/tests/patsyn/should_compile/T10997_1a.hs
@@ -1,11 +1,11 @@
{-# LANGUAGE PatternSynonyms, ViewPatterns, ConstraintKinds, TypeFamilies, PolyKinds, KindSignatures #-}
module T10997_1a where
-import GHC.Exts
+import Data.Kind
type family Showable (a :: k) :: Constraint where
- Showable (a :: *) = (Show a)
- Showable a = ()
+ Showable (a :: Type) = (Show a)
+ Showable a = ()
extractJust :: Maybe a -> (Bool, a)
extractJust (Just a) = (True, a)
diff --git a/testsuite/tests/patsyn/should_compile/T12968.hs b/testsuite/tests/patsyn/should_compile/T12968.hs
index 99626df1a7..e4b58ed8ac 100644
--- a/testsuite/tests/patsyn/should_compile/T12968.hs
+++ b/testsuite/tests/patsyn/should_compile/T12968.hs
@@ -6,7 +6,8 @@ module T12968 where
data TypeRep (a :: k)
data TRAppG (fun :: k2) where
- TRAppG :: forall k1 (a :: k1 -> k2) (b :: k1) . TypeRep a -> TypeRep b -> TRAppG (a b)
+ TRAppG :: forall k1 k2 (a :: k1 -> k2) (b :: k1) .
+ TypeRep a -> TypeRep b -> TRAppG (a b)
pattern TRApp :: forall k2 (fun :: k2). ()
=> forall k1 (a :: k1 -> k2) (b :: k1). (fun ~ a b)
diff --git a/testsuite/tests/patsyn/should_compile/T8966.hs b/testsuite/tests/patsyn/should_compile/T8966.hs
index 895ff1b764..655969e3bb 100644
--- a/testsuite/tests/patsyn/should_compile/T8966.hs
+++ b/testsuite/tests/patsyn/should_compile/T8966.hs
@@ -2,7 +2,9 @@
module T8966 where
-data NQ :: [k] -> * where
+import Data.Kind (Type)
+
+data NQ :: [k] -> Type where
D :: NQ '[a]
pattern Q = D
diff --git a/testsuite/tests/patsyn/should_compile/T8968-1.hs b/testsuite/tests/patsyn/should_compile/T8968-1.hs
index a0e3285a4b..adef52f1ff 100644
--- a/testsuite/tests/patsyn/should_compile/T8968-1.hs
+++ b/testsuite/tests/patsyn/should_compile/T8968-1.hs
@@ -1,7 +1,9 @@
{-# LANGUAGE GADTs, KindSignatures, PatternSynonyms #-}
module ShouldCompile where
-data X :: (* -> *) -> * -> * where
+import Data.Kind (Type)
+
+data X :: (Type -> Type) -> Type -> Type where
Y :: f a -> X f (Maybe a)
pattern C :: a -> X Maybe (Maybe a)
diff --git a/testsuite/tests/patsyn/should_compile/T8968-2.hs b/testsuite/tests/patsyn/should_compile/T8968-2.hs
index 0b196a5f88..2ec4d2dfb5 100644
--- a/testsuite/tests/patsyn/should_compile/T8968-2.hs
+++ b/testsuite/tests/patsyn/should_compile/T8968-2.hs
@@ -1,7 +1,9 @@
{-# LANGUAGE GADTs, KindSignatures, PatternSynonyms, FlexibleContexts #-}
module ShouldCompile where
-data X :: (* -> *) -> * -> * where
+import Data.Kind (Type)
+
+data X :: (Type -> Type) -> Type -> Type where
Y :: (Show a) => f a -> X f (Maybe a)
pattern C :: (Show (a, Bool)) => a -> X Maybe (Maybe (a, Bool))