diff options
author | Thomas Winant <dewinant@gmail.com> | 2021-01-20 18:25:33 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-05-29 05:04:00 -0400 |
commit | 5ae070f168ba7f9679b045ea4b8f30917f47f800 (patch) | |
tree | 4b5a5a30d8bfca4bf42b169a2a23f7c68d6e6ffe /testsuite/tests | |
parent | df997fac54bbadd399593f49228b6292e71145f1 (diff) | |
download | haskell-5ae070f168ba7f9679b045ea4b8f30917f47f800.tar.gz |
Add -Wmissing-exported-pattern-synonym-signatures
After !4741, it was no longer possible to silence a warning about a missing
pattern synonym signature if the `-Wmissing-signatures` flag was on.
Restore the previous semantics while still adhering to the principle "enabling
an additional warning flag should never make prior warnings disappear".
For more symmetry and granularity, introduce
`-Wmissing-exported-pattern-synonym-signatures`.
See Note [Missing signatures] for an overview of all flags involved.
Diffstat (limited to 'testsuite/tests')
15 files changed, 74 insertions, 224 deletions
diff --git a/testsuite/tests/warnings/should_compile/T14794a.hs b/testsuite/tests/warnings/should_compile/T14794a.hs index 224eaf64f7..216ef832b3 100644 --- a/testsuite/tests/warnings/should_compile/T14794a.hs +++ b/testsuite/tests/warnings/should_compile/T14794a.hs @@ -1,31 +1,16 @@ {-# LANGUAGE PatternSynonyms #-} -{-# OPTIONS_GHC -Wmissing-signatures -Wmissing-exported-signatures -Wmissing-pattern-synonym-signatures #-} +{-# OPTIONS_GHC -Wmissing-signatures #-} -module T14794a (test1, pattern Test2, test3, pattern Test4) where +module T14794a (testExported, pattern TestExported) where --- This should generate warnings with; --- -Wmissing-signatures -Wmissing-exported-signatures -Wmissing-pattern-synonym-signatures +-- These should generate warnings: -test3 = True +testExported = True -pattern Test4 <- True +testUnexported = True -test7 = True +-- These should not generate warnings: -pattern Test8 <- True +pattern TestExported <- True - --- This should not generate warnings with; --- -Wmissing-signatures -Wmissing-exported-signatures -Wmissing-pattern-synonym-signatures - -test1 :: Bool -test1 = True - -pattern Test2 :: Bool -pattern Test2 <- True - -test5 :: Bool -test5 = True - -pattern Test6 :: Bool -pattern Test6 <- True +pattern TestUnexported <- True diff --git a/testsuite/tests/warnings/should_compile/T14794a.stderr b/testsuite/tests/warnings/should_compile/T14794a.stderr index 166d59ab37..807a070350 100644 --- a/testsuite/tests/warnings/should_compile/T14794a.stderr +++ b/testsuite/tests/warnings/should_compile/T14794a.stderr @@ -1,12 +1,6 @@ -T14794a.hs:9:1: warning: [-Wmissing-signatures (in -Wall)] - Top-level binding with no type signature: test3 :: Bool +T14794a.hs:8:1: warning: [-Wmissing-signatures (in -Wall)] + Top-level binding with no type signature: testExported :: Bool -T14794a.hs:11:1: warning: [-Wmissing-signatures (in -Wall)] - Pattern synonym with no type signature: pattern Test4 :: Bool - -T14794a.hs:13:1: warning: [-Wmissing-signatures (in -Wall)] - Top-level binding with no type signature: test7 :: Bool - -T14794a.hs:15:1: warning: [-Wmissing-signatures (in -Wall)] - Pattern synonym with no type signature: pattern Test8 :: Bool +T14794a.hs:10:1: warning: [-Wmissing-signatures (in -Wall)] + Top-level binding with no type signature: testUnexported :: Bool diff --git a/testsuite/tests/warnings/should_compile/T14794b.hs b/testsuite/tests/warnings/should_compile/T14794b.hs index 7c542b4dc1..90501d0fa7 100644 --- a/testsuite/tests/warnings/should_compile/T14794b.hs +++ b/testsuite/tests/warnings/should_compile/T14794b.hs @@ -1,31 +1,16 @@ {-# LANGUAGE PatternSynonyms #-} -{-# OPTIONS_GHC -Wmissing-signatures -Wmissing-exported-signatures #-} +{-# OPTIONS_GHC -Wmissing-exported-signatures #-} -module T14794b (test1, pattern Test2, test3, pattern Test4) where +module T14794b (testExported, pattern TestExported) where --- This should generate warnings with; --- -Wmissing-signatures -Wmissing-exported-signatures +-- These should generate warnings: -test3 = True +testExported = True -pattern Test4 <- True +-- These should not generate warnings: -test7 = True +testUnexported = True -pattern Test8 <- True +pattern TestExported <- True - --- This should not generate warnings with; --- -Wmissing-signatures -Wmissing-exported-signatures - -test1 :: Bool -test1 = True - -pattern Test2 :: Bool -pattern Test2 <- True - -test5 :: Bool -test5 = True - -pattern Test6 :: Bool -pattern Test6 <- True +pattern TestUnexported <- True diff --git a/testsuite/tests/warnings/should_compile/T14794b.stderr b/testsuite/tests/warnings/should_compile/T14794b.stderr index 6109a4c985..8f7f7e805b 100644 --- a/testsuite/tests/warnings/should_compile/T14794b.stderr +++ b/testsuite/tests/warnings/should_compile/T14794b.stderr @@ -1,12 +1,3 @@ -T14794b.hs:9:1: warning: [-Wmissing-signatures (in -Wall)] - Top-level binding with no type signature: test3 :: Bool - -T14794b.hs:11:1: warning: [-Wmissing-signatures (in -Wall)] - Pattern synonym with no type signature: pattern Test4 :: Bool - -T14794b.hs:13:1: warning: [-Wmissing-signatures (in -Wall)] - Top-level binding with no type signature: test7 :: Bool - -T14794b.hs:15:1: warning: [-Wmissing-signatures (in -Wall)] - Pattern synonym with no type signature: pattern Test8 :: Bool +T14794b.hs:8:1: warning: [-Wmissing-exported-signatures] + Top-level binding with no type signature: testExported :: Bool diff --git a/testsuite/tests/warnings/should_compile/T14794c.hs b/testsuite/tests/warnings/should_compile/T14794c.hs index 742ca3c91c..fd30cfdfcd 100644 --- a/testsuite/tests/warnings/should_compile/T14794c.hs +++ b/testsuite/tests/warnings/should_compile/T14794c.hs @@ -1,31 +1,16 @@ {-# LANGUAGE PatternSynonyms #-} -{-# OPTIONS_GHC -Wmissing-signatures -Wmissing-pattern-synonym-signatures #-} +{-# OPTIONS_GHC -Wmissing-signatures -Wmissing-exported-signatures #-} -module T14794c (test1, pattern Test2, test3, pattern Test4) where +module T14794c (testExported, pattern TestExported) where --- This should generate warnings with; --- -Wmissing-signatures -Wmissing-pattern-synonym-signatures +-- These should generate warnings: -test3 = True +testExported = True -pattern Test4 <- True +testUnexported = True -test7 = True +-- These should not generate warnings: -pattern Test8 <- True +pattern TestExported <- True - --- This should not generate warnings with; --- -Wmissing-signatures -Wmissing-pattern-synonym-signatures - -test1 :: Bool -test1 = True - -pattern Test2 :: Bool -pattern Test2 <- True - -test5 :: Bool -test5 = True - -pattern Test6 :: Bool -pattern Test6 <- True +pattern TestUnexported <- True diff --git a/testsuite/tests/warnings/should_compile/T14794c.stderr b/testsuite/tests/warnings/should_compile/T14794c.stderr index 95cbb4d16f..413eea960f 100644 --- a/testsuite/tests/warnings/should_compile/T14794c.stderr +++ b/testsuite/tests/warnings/should_compile/T14794c.stderr @@ -1,12 +1,6 @@ -T14794c.hs:9:1: warning: [-Wmissing-signatures (in -Wall)] - Top-level binding with no type signature: test3 :: Bool +T14794c.hs:8:1: warning: [-Wmissing-signatures (in -Wall)] + Top-level binding with no type signature: testExported :: Bool -T14794c.hs:11:1: warning: [-Wmissing-signatures (in -Wall)] - Pattern synonym with no type signature: pattern Test4 :: Bool - -T14794c.hs:13:1: warning: [-Wmissing-signatures (in -Wall)] - Top-level binding with no type signature: test7 :: Bool - -T14794c.hs:15:1: warning: [-Wmissing-signatures (in -Wall)] - Pattern synonym with no type signature: pattern Test8 :: Bool +T14794c.hs:10:1: warning: [-Wmissing-signatures (in -Wall)] + Top-level binding with no type signature: testUnexported :: Bool diff --git a/testsuite/tests/warnings/should_compile/T14794d.hs b/testsuite/tests/warnings/should_compile/T14794d.hs index 8928df75d3..bb9913e6d9 100644 --- a/testsuite/tests/warnings/should_compile/T14794d.hs +++ b/testsuite/tests/warnings/should_compile/T14794d.hs @@ -1,31 +1,16 @@ {-# LANGUAGE PatternSynonyms #-} -{-# OPTIONS_GHC -Wmissing-exported-signatures -Wmissing-pattern-synonym-signatures #-} +{-# OPTIONS_GHC -Wmissing-pattern-synonym-signatures #-} -module T14794d (test1, pattern Test2, test3, pattern Test4) where +module T14794d (testExported, pattern TestExported) where --- This should generate warnings with; --- -Wmissing-exported-signatures -Wmissing-pattern-synonym-signatures +-- These should generate warnings: -test3 = True +pattern TestExported <- True -pattern Test4 <- True +pattern TestUnexported <- True +-- These should not generate warnings: --- This should not generate warnings with; --- -Wmissing-exported-signatures -Wmissing-pattern-synonym-signatures +testExported = True -test1 :: Bool -test1 = True - -pattern Test2 :: Bool -pattern Test2 <- True - -test5 :: Bool -test5 = True - -pattern Test6 :: Bool -pattern Test6 <- True - -test7 = True - -pattern Test8 <- True +testUnexported = True diff --git a/testsuite/tests/warnings/should_compile/T14794d.stderr b/testsuite/tests/warnings/should_compile/T14794d.stderr index 3388d17316..61177b520e 100644 --- a/testsuite/tests/warnings/should_compile/T14794d.stderr +++ b/testsuite/tests/warnings/should_compile/T14794d.stderr @@ -1,6 +1,8 @@ -T14794d.hs:9:1: warning: [-Wmissing-exported-signatures] - Top-level binding with no type signature: test3 :: Bool +T14794d.hs:8:1: warning: [-Wmissing-pattern-synonym-signatures (in -Wall)] + Pattern synonym with no type signature: + pattern TestExported :: Bool -T14794d.hs:11:1: warning: [-Wmissing-exported-signatures] - Pattern synonym with no type signature: pattern Test4 :: Bool +T14794d.hs:10:1: warning: [-Wmissing-pattern-synonym-signatures (in -Wall)] + Pattern synonym with no type signature: + pattern TestUnexported :: Bool diff --git a/testsuite/tests/warnings/should_compile/T14794e.hs b/testsuite/tests/warnings/should_compile/T14794e.hs index 051cf347d6..b53244de6c 100644 --- a/testsuite/tests/warnings/should_compile/T14794e.hs +++ b/testsuite/tests/warnings/should_compile/T14794e.hs @@ -1,31 +1,16 @@ {-# LANGUAGE PatternSynonyms #-} -{-# OPTIONS_GHC -Wmissing-signatures #-} +{-# OPTIONS_GHC -Wmissing-exported-pattern-synonym-signatures #-} -module T14794e (test1, pattern Test2, test3, pattern Test4) where +module T14794e (testExported, pattern TestExported) where --- This should generate warnings with; --- -Wmissing-signatures +-- These should generate warnings: -test3 = True +pattern TestExported <- True -pattern Test4 <- True +-- These should not generate warnings: -test7 = True +testExported = True -pattern Test8 <- True +testUnexported = True - --- This should not generate warnings with; --- -Wmissing-signatures - -test1 :: Bool -test1 = True - -pattern Test2 :: Bool -pattern Test2 <- True - -test5 :: Bool -test5 = True - -pattern Test6 :: Bool -pattern Test6 <- True +pattern TestUnexported <- True diff --git a/testsuite/tests/warnings/should_compile/T14794e.stderr b/testsuite/tests/warnings/should_compile/T14794e.stderr index f0e4ddbc4c..b7c70b6e51 100644 --- a/testsuite/tests/warnings/should_compile/T14794e.stderr +++ b/testsuite/tests/warnings/should_compile/T14794e.stderr @@ -1,12 +1,4 @@ -T14794e.hs:9:1: warning: [-Wmissing-signatures (in -Wall)] - Top-level binding with no type signature: test3 :: Bool - -T14794e.hs:11:1: warning: [-Wmissing-signatures (in -Wall)] - Pattern synonym with no type signature: pattern Test4 :: Bool - -T14794e.hs:13:1: warning: [-Wmissing-signatures (in -Wall)] - Top-level binding with no type signature: test7 :: Bool - -T14794e.hs:15:1: warning: [-Wmissing-signatures (in -Wall)] - Pattern synonym with no type signature: pattern Test8 :: Bool +T14794e.hs:8:1: warning: [-Wmissing-exported-pattern-synonym-signatures] + Pattern synonym with no type signature: + pattern TestExported :: Bool diff --git a/testsuite/tests/warnings/should_compile/T14794f.hs b/testsuite/tests/warnings/should_compile/T14794f.hs index c2cf58f174..2ebb7e0235 100644 --- a/testsuite/tests/warnings/should_compile/T14794f.hs +++ b/testsuite/tests/warnings/should_compile/T14794f.hs @@ -1,31 +1,16 @@ {-# LANGUAGE PatternSynonyms #-} -{-# OPTIONS_GHC -Wmissing-exported-signatures #-} +{-# OPTIONS_GHC -Wmissing-pattern-synonym-signatures -Wmissing-exported-pattern-synonym-signatures #-} -module T14794f (test1, pattern Test2, test3, pattern Test4) where +module T14794d (testExported, pattern TestExported) where --- This should generate warnings with; --- -Wmissing-exported-signatures +-- These should generate warnings: -test3 = True +pattern TestExported <- True +pattern TestUnexported <- True --- This should not generate warnings with; --- -Wmissing-exported-signatures +-- These should not generate warnings: -test1 :: Bool -test1 = True +testExported = True -pattern Test2 :: Bool -pattern Test2 <- True - -pattern Test4 <- True - -test5 :: Bool -test5 = True - -pattern Test6 :: Bool -pattern Test6 <- True - -test7 = True - -pattern Test8 <- True +testUnexported = True diff --git a/testsuite/tests/warnings/should_compile/T14794f.stderr b/testsuite/tests/warnings/should_compile/T14794f.stderr index b751aad98e..fd138d5911 100644 --- a/testsuite/tests/warnings/should_compile/T14794f.stderr +++ b/testsuite/tests/warnings/should_compile/T14794f.stderr @@ -1,3 +1,8 @@ -T14794f.hs:9:1: warning: [-Wmissing-exported-signatures] - Top-level binding with no type signature: test3 :: Bool +T14794f.hs:8:1: warning: [-Wmissing-pattern-synonym-signatures (in -Wall)] + Pattern synonym with no type signature: + pattern TestExported :: Bool + +T14794f.hs:10:1: warning: [-Wmissing-pattern-synonym-signatures (in -Wall)] + Pattern synonym with no type signature: + pattern TestUnexported :: Bool diff --git a/testsuite/tests/warnings/should_compile/T14794g.hs b/testsuite/tests/warnings/should_compile/T14794g.hs deleted file mode 100644 index eec2210203..0000000000 --- a/testsuite/tests/warnings/should_compile/T14794g.hs +++ /dev/null @@ -1,31 +0,0 @@ -{-# LANGUAGE PatternSynonyms #-} -{-# OPTIONS_GHC -Wmissing-pattern-synonym-signatures #-} - -module T14794g (test1, pattern Test2, test3, pattern Test4) where - --- This should generate warnings with; --- -Wmissing-pattern-synonym-signatures - -pattern Test4 <- True - -pattern Test8 <- True - - --- This should not generate warnings with; --- -Wmissing-pattern-synonym-signatures - -test1 :: Bool -test1 = True - -pattern Test2 :: Bool -pattern Test2 <- True - -test3 = True - -test5 :: Bool -test5 = True - -pattern Test6 :: Bool -pattern Test6 <- True - -test7 = True diff --git a/testsuite/tests/warnings/should_compile/T14794g.stderr b/testsuite/tests/warnings/should_compile/T14794g.stderr deleted file mode 100644 index abd3bf205d..0000000000 --- a/testsuite/tests/warnings/should_compile/T14794g.stderr +++ /dev/null @@ -1,6 +0,0 @@ - -T14794g.hs:9:1: warning: [-Wmissing-pattern-synonym-signatures (in -Wall)] - Pattern synonym with no type signature: pattern Test4 :: Bool - -T14794g.hs:11:1: warning: [-Wmissing-pattern-synonym-signatures (in -Wall)] - Pattern synonym with no type signature: pattern Test8 :: Bool diff --git a/testsuite/tests/warnings/should_compile/all.T b/testsuite/tests/warnings/should_compile/all.T index a2b82c9661..849ae5edfa 100644 --- a/testsuite/tests/warnings/should_compile/all.T +++ b/testsuite/tests/warnings/should_compile/all.T @@ -4,7 +4,6 @@ test('T14794c', normal, compile, ['']) test('T14794d', normal, compile, ['']) test('T14794e', normal, compile, ['']) test('T14794f', normal, compile, ['']) -test('T14794g', normal, compile, ['']) test('T9178', [], multimod_compile, ['T9178', '-Wall']) |