summaryrefslogtreecommitdiff
path: root/testsuite/tests/partial-sigs
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/partial-sigs
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/partial-sigs')
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T13482.hs4
-rw-r--r--testsuite/tests/partial-sigs/should_compile/T13482.stderr18
-rw-r--r--testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.hs4
-rw-r--r--testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr4
4 files changed, 17 insertions, 13 deletions
diff --git a/testsuite/tests/partial-sigs/should_compile/T13482.hs b/testsuite/tests/partial-sigs/should_compile/T13482.hs
index 3af3a74231..0a2c619f66 100644
--- a/testsuite/tests/partial-sigs/should_compile/T13482.hs
+++ b/testsuite/tests/partial-sigs/should_compile/T13482.hs
@@ -5,10 +5,12 @@
module T12382 where
+import Data.Kind (Type)
+
minimal1_noksig :: forall m. ( _ ) => Int -> Bool
minimal1_noksig _ = (mempty :: m) == (mempty :: m)
-minimal1 :: forall (m :: *). _ => Bool
+minimal1 :: forall (m :: Type). _ => Bool
minimal1 = (mempty :: m) == (mempty :: m)
minimal2 :: forall m. (Eq m, _) => Bool
diff --git a/testsuite/tests/partial-sigs/should_compile/T13482.stderr b/testsuite/tests/partial-sigs/should_compile/T13482.stderr
index dd46400b1a..a21b7dcac4 100644
--- a/testsuite/tests/partial-sigs/should_compile/T13482.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/T13482.stderr
@@ -1,31 +1,31 @@
-T13482.hs:8:32: warning: [-Wpartial-type-signatures (in -Wdefault)]
+T13482.hs:10:32: warning: [-Wpartial-type-signatures (in -Wdefault)]
• Found type wildcard ‘_’ standing for ‘(Eq m, Monoid m)’
Where: ‘m’ is a rigid type variable bound by
the inferred type of
minimal1_noksig :: (Eq m, Monoid m) => Int -> Bool
- at T13482.hs:9:1-50
+ at T13482.hs:11:1-50
• In the type signature:
minimal1_noksig :: forall m. _ => Int -> Bool
-T13482.hs:11:30: warning: [-Wpartial-type-signatures (in -Wdefault)]
+T13482.hs:13:33: warning: [-Wpartial-type-signatures (in -Wdefault)]
• Found type wildcard ‘_’ standing for ‘(Eq m, Monoid m)’
Where: ‘m’ is a rigid type variable bound by
the inferred type of minimal1 :: (Eq m, Monoid m) => Bool
- at T13482.hs:12:1-41
- • In the type signature: minimal1 :: forall (m :: *). _ => Bool
+ at T13482.hs:14:1-41
+ • In the type signature: minimal1 :: forall (m :: Type). _ => Bool
-T13482.hs:14:30: warning: [-Wpartial-type-signatures (in -Wdefault)]
+T13482.hs:16:30: warning: [-Wpartial-type-signatures (in -Wdefault)]
• Found type wildcard ‘_’ standing for ‘Monoid m’
Where: ‘m’ is a rigid type variable bound by
the inferred type of minimal2 :: (Eq m, Monoid m) => Bool
- at T13482.hs:15:1-41
+ at T13482.hs:17:1-41
• In the type signature: minimal2 :: forall m. (Eq m, _) => Bool
-T13482.hs:17:34: warning: [-Wpartial-type-signatures (in -Wdefault)]
+T13482.hs:19:34: warning: [-Wpartial-type-signatures (in -Wdefault)]
• Found type wildcard ‘_’ standing for ‘Eq m’
Where: ‘m’ is a rigid type variable bound by
the inferred type of minimal3 :: (Monoid m, Eq m) => Bool
- at T13482.hs:18:1-41
+ at T13482.hs:20:1-41
• In the type signature:
minimal3 :: forall m. (Monoid m, _) => Bool
diff --git a/testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.hs b/testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.hs
index c3172b7cd0..cd009ca8d5 100644
--- a/testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.hs
+++ b/testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.hs
@@ -1,7 +1,9 @@
{-# LANGUAGE TypeFamilies #-}
module TypeFamilyInstanceLHS where
-type family F (a :: *) (b :: *) :: *
+import Data.Kind (Type)
+
+type family F (a :: Type) (b :: Type) :: Type
type instance F Int _ = Int
type instance F Bool _ = Bool
diff --git a/testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr b/testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr
index 1a783cba74..76c5b3fbc3 100644
--- a/testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/TypeFamilyInstanceLHS.stderr
@@ -5,9 +5,9 @@ TYPE CONSTRUCTORS
F :: * -> * -> *
COERCION AXIOMS
axiom TypeFamilyInstanceLHS.D:R:FBool_ ::
- F Bool _ = Bool -- Defined at TypeFamilyInstanceLHS.hs:6:15
+ F Bool _ = Bool -- Defined at TypeFamilyInstanceLHS.hs:8:15
axiom TypeFamilyInstanceLHS.D:R:FInt_ ::
- F Int _ = Int -- Defined at TypeFamilyInstanceLHS.hs:5:15
+ F Int _ = Int -- Defined at TypeFamilyInstanceLHS.hs:7:15
FAMILY INSTANCES
type instance F Int _
type instance F Bool _