summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2023-01-14 14:41:39 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-01-18 01:56:22 -0500
commite9c0537cfbf7b47c64f592f529e402358b66ca7f (patch)
treea1e9fe1b5dadf437f7b8bf5dada0d11e4c7d8283 /testsuite
parentee9b78aa17e1eb81b3c4aa6a5ce324de49530e92 (diff)
downloadhaskell-e9c0537cfbf7b47c64f592f529e402358b66ca7f.tar.gz
Enable -Wstar-is-type by default (#22759)
Following the plan in GHC Proposal #143 "Remove the * kind syntax", which states: In the next release (or 3 years in), enable -fwarn-star-is-type by default. The "next release" happens to be 9.6.1 I also moved the T21583 test case from should_fail to should_compile, because the only reason it was failing was -Werror=compat in our test suite configuration.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/ghci/scripts/ghci024.stdout1
-rw-r--r--testsuite/tests/ghci/scripts/ghci024.stdout-mingw321
-rw-r--r--testsuite/tests/typecheck/should_compile/T21583.hs (renamed from testsuite/tests/typecheck/should_fail/T21583.hs)4
-rw-r--r--testsuite/tests/typecheck/should_compile/T21583.stderr15
-rw-r--r--testsuite/tests/typecheck/should_compile/all.T1
-rw-r--r--testsuite/tests/typecheck/should_fail/T21583.stderr27
-rw-r--r--testsuite/tests/typecheck/should_fail/all.T1
-rw-r--r--testsuite/tests/warnings/should_compile/T22759.hs4
-rw-r--r--testsuite/tests/warnings/should_compile/T22759.stderr6
-rw-r--r--testsuite/tests/warnings/should_compile/all.T1
-rw-r--r--testsuite/tests/wcompat-warnings/Template.hs6
-rw-r--r--testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr12
12 files changed, 33 insertions, 46 deletions
diff --git a/testsuite/tests/ghci/scripts/ghci024.stdout b/testsuite/tests/ghci/scripts/ghci024.stdout
index c7ddba4f62..ea2b56d35d 100644
--- a/testsuite/tests/ghci/scripts/ghci024.stdout
+++ b/testsuite/tests/ghci/scripts/ghci024.stdout
@@ -16,7 +16,6 @@ other dynamic, non-language, flag settings:
-fprefer-byte-code
warning settings:
-Wsemigroup
- -Wstar-is-type
-Wcompat-unqualified-imports
-Wtype-equality-out-of-scope
~~~~~~~~~~ Testing :set -a
diff --git a/testsuite/tests/ghci/scripts/ghci024.stdout-mingw32 b/testsuite/tests/ghci/scripts/ghci024.stdout-mingw32
index 7dea29c218..e5e54a12b0 100644
--- a/testsuite/tests/ghci/scripts/ghci024.stdout-mingw32
+++ b/testsuite/tests/ghci/scripts/ghci024.stdout-mingw32
@@ -15,7 +15,6 @@ other dynamic, non-language, flag settings:
-fprefer-byte-code
warning settings:
-Wsemigroup
- -Wstar-is-type
-Wcompat-unqualified-imports
-Wtype-equality-out-of-scope
~~~~~~~~~~ Testing :set -a
diff --git a/testsuite/tests/typecheck/should_fail/T21583.hs b/testsuite/tests/typecheck/should_compile/T21583.hs
index 5b7873dce6..7146e1de03 100644
--- a/testsuite/tests/typecheck/should_fail/T21583.hs
+++ b/testsuite/tests/typecheck/should_compile/T21583.hs
@@ -5,13 +5,15 @@
{-# LANGUAGE FlexibleContexts #-}
module Telomare.Possible where
+import Data.Kind (Type)
+
data PartExprF f
= ZeroSF
deriving (Eq, Ord, Show, Functor, Foldable, Traversable)
newtype EnhancedExpr f = EnhancedExpr {unEnhanceExpr :: SplitFunctor f PartExprF (EnhancedExpr f)} -- deriving (Eq, Show)
-type family Base t :: * -> *
+type family Base t :: Type -> Type
type instance Base (EnhancedExpr f) = SplitFunctor f PartExprF
diff --git a/testsuite/tests/typecheck/should_compile/T21583.stderr b/testsuite/tests/typecheck/should_compile/T21583.stderr
new file mode 100644
index 0000000000..b05cadf933
--- /dev/null
+++ b/testsuite/tests/typecheck/should_compile/T21583.stderr
@@ -0,0 +1,15 @@
+
+T21583.hs:58:10: warning: [GHC-06201] [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ ‘fmap’
+ • In the instance declaration for ‘Functor (SplitFunctor g f)’
+
+T21583.hs:60:10: warning: [GHC-06201] [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ either ‘foldMap’ or ‘foldr’
+ • In the instance declaration for ‘Foldable (SplitFunctor g f)’
+
+T21583.hs:62:10: warning: [GHC-06201] [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ either ‘traverse’ or ‘sequenceA’
+ • In the instance declaration for ‘Traversable (SplitFunctor g f)’
diff --git a/testsuite/tests/typecheck/should_compile/all.T b/testsuite/tests/typecheck/should_compile/all.T
index 0a1edfa866..fc5ce4936b 100644
--- a/testsuite/tests/typecheck/should_compile/all.T
+++ b/testsuite/tests/typecheck/should_compile/all.T
@@ -825,6 +825,7 @@ test('T21328', normal, compile, [''])
test('T21516', normal, compile, [''])
test('T21519', normal, compile, [''])
test('T21519a', normal, compile, [''])
+test('T21583', normal, compile, [''])
test('T2595', normal, compile, [''])
test('T3632', normal, compile, [''])
test('T10808', normal, compile, [''])
diff --git a/testsuite/tests/typecheck/should_fail/T21583.stderr b/testsuite/tests/typecheck/should_fail/T21583.stderr
deleted file mode 100644
index 04aa3d938d..0000000000
--- a/testsuite/tests/typecheck/should_fail/T21583.stderr
+++ /dev/null
@@ -1,27 +0,0 @@
-
-T21583.hs:14:23: error: [GHC-39567] [-Wstar-is-type (in -Wall, -Wcompat), Werror=star-is-type]
- Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’
- relies on the StarIsType extension, which will become
- deprecated in the future.
- Suggested fix: Use ‘Type’ from ‘Data.Kind’ instead.
-
-T21583.hs:14:28: error: [GHC-39567] [-Wstar-is-type (in -Wall, -Wcompat), Werror=star-is-type]
- Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’
- relies on the StarIsType extension, which will become
- deprecated in the future.
- Suggested fix: Use ‘Type’ from ‘Data.Kind’ instead.
-
-T21583.hs:56:10: warning: [GHC-06201] [-Wmissing-methods (in -Wdefault)]
- • No explicit implementation for
- ‘fmap’
- • In the instance declaration for ‘Functor (SplitFunctor g f)’
-
-T21583.hs:58:10: warning: [GHC-06201] [-Wmissing-methods (in -Wdefault)]
- • No explicit implementation for
- either ‘foldMap’ or ‘foldr’
- • In the instance declaration for ‘Foldable (SplitFunctor g f)’
-
-T21583.hs:60:10: warning: [GHC-06201] [-Wmissing-methods (in -Wdefault)]
- • No explicit implementation for
- either ‘traverse’ or ‘sequenceA’
- • In the instance declaration for ‘Traversable (SplitFunctor g f)’
diff --git a/testsuite/tests/typecheck/should_fail/all.T b/testsuite/tests/typecheck/should_fail/all.T
index bfb7b311a0..5224a58aa6 100644
--- a/testsuite/tests/typecheck/should_fail/all.T
+++ b/testsuite/tests/typecheck/should_fail/all.T
@@ -660,7 +660,6 @@ test('T20768_fail', normal, compile_fail, [''])
test('T21327', normal, compile_fail, [''])
test('T21338', normal, compile_fail, [''])
test('T21158', normal, compile_fail, [''])
-test('T21583', normal, compile_fail, [''])
test('MissingDefaultMethodBinding', normal, compile_fail, [''])
test('T21447', normal, compile_fail, [''])
test('T21530a', normal, compile_fail, [''])
diff --git a/testsuite/tests/warnings/should_compile/T22759.hs b/testsuite/tests/warnings/should_compile/T22759.hs
new file mode 100644
index 0000000000..7834eeeb1e
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T22759.hs
@@ -0,0 +1,4 @@
+module T22759 where
+
+b :: (Bool :: *)
+b = True \ No newline at end of file
diff --git a/testsuite/tests/warnings/should_compile/T22759.stderr b/testsuite/tests/warnings/should_compile/T22759.stderr
new file mode 100644
index 0000000000..deb0842a47
--- /dev/null
+++ b/testsuite/tests/warnings/should_compile/T22759.stderr
@@ -0,0 +1,6 @@
+
+T22759.hs:3:15: warning: [GHC-39567] [-Wstar-is-type (in -Wdefault)]
+ Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’
+ relies on the StarIsType extension, which will become
+ deprecated in the future.
+ Suggested fix: Use ‘Type’ from ‘Data.Kind’ instead.
diff --git a/testsuite/tests/warnings/should_compile/all.T b/testsuite/tests/warnings/should_compile/all.T
index 40d1ce12f0..3139a042e2 100644
--- a/testsuite/tests/warnings/should_compile/all.T
+++ b/testsuite/tests/warnings/should_compile/all.T
@@ -53,3 +53,4 @@ test('DerivingTypeable', normal, compile, ['-Wderiving-typeable'])
test('T18862a', normal, compile, [''])
test('T18862b', normal, compile, [''])
test('T20312', normal, compile,['-Wall'])
+test('T22759', normal, compile, [''])
diff --git a/testsuite/tests/wcompat-warnings/Template.hs b/testsuite/tests/wcompat-warnings/Template.hs
index 798eafc787..2a9a11b0c4 100644
--- a/testsuite/tests/wcompat-warnings/Template.hs
+++ b/testsuite/tests/wcompat-warnings/Template.hs
@@ -1,5 +1,3 @@
-{-# LANGUAGE KindSignatures #-}
-
module WCompatWarningsOnOff where
import qualified Data.Semigroup as Semi
@@ -15,7 +13,3 @@ instance Semi.Semigroup S where
instance Monoid S where
S a `mappend` S b = S (a+b)
mempty = S 0
-
--- -fwarn-star-is-type
-b :: (Bool :: *)
-b = True
diff --git a/testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr b/testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr
index a24d18353d..aaf0772b41 100644
--- a/testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr
+++ b/testsuite/tests/wcompat-warnings/WCompatWarningsOn.stderr
@@ -1,23 +1,17 @@
-Template.hs:7:1: warning: [-Wsemigroup (in -Wcompat)]
+Template.hs:5:1: warning: [-Wsemigroup (in -Wcompat)]
Local definition of ‘<>’ clashes with a future Prelude name.
This will become an error in a future release.
-Template.hs:13:3: warning: [-Wnoncanonical-monoid-instances (in -Wdefault, -Wcompat)]
+Template.hs:11:3: warning: [-Wnoncanonical-monoid-instances (in -Wdefault, -Wcompat)]
Noncanonical ‘(<>) = mappend’ definition detected
in the instance declaration for ‘Semigroup S’.
Move definition from ‘mappend’ to ‘(<>)’
See also: https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/semigroup-monoid
-Template.hs:16:3: warning: [-Wnoncanonical-monoid-instances (in -Wdefault, -Wcompat)]
+Template.hs:14:3: warning: [-Wnoncanonical-monoid-instances (in -Wdefault, -Wcompat)]
Noncanonical ‘mappend’ definition detected
in the instance declaration for ‘Monoid S’.
‘mappend’ will eventually be removed in favour of ‘(<>)’
Either remove definition for ‘mappend’ (recommended) or define as ‘mappend = (<>)’
See also: https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/semigroup-monoid
-
-Template.hs:20:15: warning: [GHC-39567] [-Wstar-is-type (in -Wall, -Wcompat)]
- Using ‘*’ (or its Unicode variant) to mean ‘Data.Kind.Type’
- relies on the StarIsType extension, which will become
- deprecated in the future.
- Suggested fix: Use ‘Type’ from ‘Data.Kind’ instead.