From 165d3d5ddaecc7dbe7f5ac051834a7619463efb0 Mon Sep 17 00:00:00 2001 From: Vladislav Zavialov Date: Mon, 15 Oct 2018 13:52:12 -0400 Subject: 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 --- testsuite/tests/partial-sigs/should_compile/T13482.hs | 4 +++- .../tests/partial-sigs/should_compile/T13482.stderr | 18 +++++++++--------- .../should_compile/TypeFamilyInstanceLHS.hs | 4 +++- .../should_compile/TypeFamilyInstanceLHS.stderr | 4 ++-- 4 files changed, 17 insertions(+), 13 deletions(-) (limited to 'testsuite/tests/partial-sigs') 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 _ -- cgit v1.2.1