diff options
author | Vladislav Zavialov <vlad.z.4096@gmail.com> | 2018-10-15 13:52:12 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-10-15 19:24:16 -0400 |
commit | 165d3d5ddaecc7dbe7f5ac051834a7619463efb0 (patch) | |
tree | 6ae7967d95ddc071a6dda7e3307f4a16cbf2229f /testsuite/tests/parser/should_compile/DumpRenamedAst.hs | |
parent | 058c2813d882266309e8045af7a72eedecbf2dbb (diff) | |
download | haskell-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/parser/should_compile/DumpRenamedAst.hs')
-rw-r--r-- | testsuite/tests/parser/should_compile/DumpRenamedAst.hs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/testsuite/tests/parser/should_compile/DumpRenamedAst.hs b/testsuite/tests/parser/should_compile/DumpRenamedAst.hs index bf3e372461..c617febd40 100644 --- a/testsuite/tests/parser/should_compile/DumpRenamedAst.hs +++ b/testsuite/tests/parser/should_compile/DumpRenamedAst.hs @@ -1,18 +1,20 @@ {-# LANGUAGE DataKinds, GADTs, PolyKinds, RankNTypes, TypeOperators, - TypeFamilies, StarIsType #-} + TypeFamilies #-} module DumpRenamedAst where +import Data.Kind (Type) + data Peano = Zero | Succ Peano type family Length (as :: [k]) :: Peano where Length (a : as) = Succ (Length as) Length '[] = Zero -data family Nat :: k -> k -> * +data family Nat :: k -> k -> Type -- Ensure that the `k` in the type pattern and `k` in the kind signature have -- the same binding site. -newtype instance Nat (a :: k -> *) :: (k -> *) -> * where +newtype instance Nat (a :: k -> Type) :: (k -> Type) -> Type where Nat :: (forall xx. f xx -> g xx) -> Nat f g main = putStrLn "hello" |