summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck
diff options
context:
space:
mode:
authorMichael Walker <mike@barrucadu.co.uk>2016-02-25 17:34:07 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2016-02-25 23:44:08 +0100
commitbb5afd3c274011c5ea302210b4c290ec1f83209c (patch)
treeb6c2000e466e894207ce28dc65346853120f8548 /testsuite/tests/typecheck
parent1badf157be3b7f604ba1ac64d2ea044d783e6e50 (diff)
downloadhaskell-bb5afd3c274011c5ea302210b4c290ec1f83209c.tar.gz
Print which warning-flag controls an emitted warning
Both gcc and clang tell which warning flag a reported warning can be controlled with, this patch makes ghc do the same. More generally, this allows for annotated compiler output, where an optional annotation is displayed in brackets after the severity. This also adds a new flag `-f(no-)show-warning-groups` to control whether to show which warning-group (such as `-Wall` or `-Wcompat`) a warning belongs to. This flag is on by default. This implements #10752 Reviewed By: quchen, bgamari, hvr Differential Revision: https://phabricator.haskell.org/D1943
Diffstat (limited to 'testsuite/tests/typecheck')
-rw-r--r--testsuite/tests/typecheck/prog001/typecheck.prog001.stderr8
-rw-r--r--testsuite/tests/typecheck/should_compile/HasKey.stderr8
-rw-r--r--testsuite/tests/typecheck/should_compile/T10935.stderr10
-rw-r--r--testsuite/tests/typecheck/should_compile/T10971a.stderr16
-rw-r--r--testsuite/tests/typecheck/should_compile/T2497.stderr3
-rw-r--r--testsuite/tests/typecheck/should_compile/T3696.stderr2
-rw-r--r--testsuite/tests/typecheck/should_compile/T4912.stderr4
-rw-r--r--testsuite/tests/typecheck/should_compile/T7903.stderr16
-rw-r--r--testsuite/tests/typecheck/should_compile/T9497a.stderr2
-rw-r--r--testsuite/tests/typecheck/should_compile/holes.stderr8
-rw-r--r--testsuite/tests/typecheck/should_compile/holes2.stderr2
-rw-r--r--testsuite/tests/typecheck/should_compile/tc078.stderr16
-rw-r--r--testsuite/tests/typecheck/should_compile/tc115.stderr8
-rw-r--r--testsuite/tests/typecheck/should_compile/tc116.stderr8
-rw-r--r--testsuite/tests/typecheck/should_compile/tc125.stderr41
-rw-r--r--testsuite/tests/typecheck/should_compile/tc126.stderr16
-rw-r--r--testsuite/tests/typecheck/should_compile/tc161.stderr8
-rw-r--r--testsuite/tests/typecheck/should_compile/tc175.stderr8
-rw-r--r--testsuite/tests/typecheck/should_compile/tc243.stderr2
-rw-r--r--testsuite/tests/typecheck/should_compile/tc254.stderr6
-rw-r--r--testsuite/tests/typecheck/should_fail/T5051.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail204.stderr2
22 files changed, 99 insertions, 97 deletions
diff --git a/testsuite/tests/typecheck/prog001/typecheck.prog001.stderr b/testsuite/tests/typecheck/prog001/typecheck.prog001.stderr
index 70e210fa3e..3893a29237 100644
--- a/testsuite/tests/typecheck/prog001/typecheck.prog001.stderr
+++ b/testsuite/tests/typecheck/prog001/typecheck.prog001.stderr
@@ -1,5 +1,5 @@
-B.hs:7:10: Warning:
- No explicit implementation for
- ‘row’
- In the instance declaration for ‘Matrix Bool Val’
+B.hs:7:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ ‘row’
+ • In the instance declaration for ‘Matrix Bool Val’
diff --git a/testsuite/tests/typecheck/should_compile/HasKey.stderr b/testsuite/tests/typecheck/should_compile/HasKey.stderr
index dd4d290cda..76b78a6491 100644
--- a/testsuite/tests/typecheck/should_compile/HasKey.stderr
+++ b/testsuite/tests/typecheck/should_compile/HasKey.stderr
@@ -1,5 +1,5 @@
-HasKey.hs:22:10: Warning:
- No explicit implementation for
- either ‘compare’ or ‘<=’
- In the instance declaration for ‘Ord (Keyed x)’
+HasKey.hs:22:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ either ‘compare’ or ‘<=’
+ • In the instance declaration for ‘Ord (Keyed x)’
diff --git a/testsuite/tests/typecheck/should_compile/T10935.stderr b/testsuite/tests/typecheck/should_compile/T10935.stderr
index 2279cfc90b..b8db0fb4bd 100644
--- a/testsuite/tests/typecheck/should_compile/T10935.stderr
+++ b/testsuite/tests/typecheck/should_compile/T10935.stderr
@@ -1,6 +1,6 @@
-T10935.hs:5:11: warning:
- The Monomorphism Restriction applies to the binding for ‘y’
- Consider giving a type signature for ‘y’
- In the expression: let y = x + 1 in (y, y)
- In an equation for ‘f’: f x = let y = x + 1 in (y, y)
+T10935.hs:5:11: warning: [-Wmonomorphism-restriction]
+ • The Monomorphism Restriction applies to the binding for ‘y’
+ Consider giving a type signature for ‘y’
+ • In the expression: let y = x + 1 in (y, y)
+ In an equation for ‘f’: f x = let y = x + 1 in (y, y)
diff --git a/testsuite/tests/typecheck/should_compile/T10971a.stderr b/testsuite/tests/typecheck/should_compile/T10971a.stderr
index eea8a11ea3..0702b32384 100644
--- a/testsuite/tests/typecheck/should_compile/T10971a.stderr
+++ b/testsuite/tests/typecheck/should_compile/T10971a.stderr
@@ -1,38 +1,38 @@
-T10971a.hs:7:1: warning:
+T10971a.hs:7:1: warning: [-Wmissing-signatures (in -Wall)]
Top-level binding with no type signature: f :: forall a. [a] -> Int
-T10971a.hs:7:11: warning:
+T10971a.hs:7:11: warning: [-Wtype-defaults (in -Wall)]
• Defaulting the following constraint to type ‘[]’
Foldable t0 arising from a use of ‘length’
• In the expression: length x
In the expression: \ x -> length x
In an equation for ‘f’: f = \ x -> length x
-T10971a.hs:8:1: warning:
+T10971a.hs:8:1: warning: [-Wmissing-signatures (in -Wall)]
Top-level binding with no type signature:
g :: forall a b. (a -> b) -> [a] -> [b]
-T10971a.hs:8:6: warning:
+T10971a.hs:8:6: warning: [-Wname-shadowing (in -Wall)]
This binding for ‘f’ shadows the existing binding
defined at T10971a.hs:7:1
-T10971a.hs:8:13: warning:
+T10971a.hs:8:13: warning: [-Wtype-defaults (in -Wall)]
• Defaulting the following constraint to type ‘[]’
Traversable t0 arising from a use of ‘fmapDefault’
• In the expression: fmapDefault f x
In the expression: \ f x -> fmapDefault f x
In an equation for ‘g’: g = \ f x -> fmapDefault f x
-T10971a.hs:9:1: warning:
+T10971a.hs:9:1: warning: [-Wmissing-signatures (in -Wall)]
Top-level binding with no type signature:
h :: forall b a. (a -> b) -> [a] -> ([b], Int)
-T10971a.hs:9:6: warning:
+T10971a.hs:9:6: warning: [-Wname-shadowing (in -Wall)]
This binding for ‘f’ shadows the existing binding
defined at T10971a.hs:7:1
-T10971a.hs:9:31: warning:
+T10971a.hs:9:31: warning: [-Wtype-defaults (in -Wall)]
• Defaulting the following constraints to type ‘[]’
(Foldable t0) arising from a use of ‘length’ at T10971a.hs:9:31-38
(Traversable t0)
diff --git a/testsuite/tests/typecheck/should_compile/T2497.stderr b/testsuite/tests/typecheck/should_compile/T2497.stderr
index da730a05aa..2fefbbd8af 100644
--- a/testsuite/tests/typecheck/should_compile/T2497.stderr
+++ b/testsuite/tests/typecheck/should_compile/T2497.stderr
@@ -1,2 +1,3 @@
-T2497.hs:22:1: warning: Defined but not used: ‘beq’
+T2497.hs:22:1: warning: [-Wunused-local-binds (in -Wextra, -Wunused-binds)]
+ Defined but not used: ‘beq’
diff --git a/testsuite/tests/typecheck/should_compile/T3696.stderr b/testsuite/tests/typecheck/should_compile/T3696.stderr
index 06229b8fa3..6058e70d50 100644
--- a/testsuite/tests/typecheck/should_compile/T3696.stderr
+++ b/testsuite/tests/typecheck/should_compile/T3696.stderr
@@ -1,3 +1,3 @@
-T3696.hs:9:1: warning:
+T3696.hs:9:1: warning: [-Wmissing-signatures (in -Wall)]
Top-level binding with no type signature: def :: Int
diff --git a/testsuite/tests/typecheck/should_compile/T4912.stderr b/testsuite/tests/typecheck/should_compile/T4912.stderr
index 02ff1ad40e..104275cdda 100644
--- a/testsuite/tests/typecheck/should_compile/T4912.stderr
+++ b/testsuite/tests/typecheck/should_compile/T4912.stderr
@@ -1,11 +1,11 @@
-T4912.hs:10:1: warning:
+T4912.hs:10:1: warning: [-Worphans (in -Wall)]
Orphan instance: instance Foo TheirData
To avoid this
move the instance declaration to the module of the class or of the type, or
wrap the type with a newtype and declare the instance on the new type.
-T4912.hs:13:1: warning:
+T4912.hs:13:1: warning: [-Worphans (in -Wall)]
Orphan instance: instance Bar OurData
To avoid this
move the instance declaration to the module of the class or of the type, or
diff --git a/testsuite/tests/typecheck/should_compile/T7903.stderr b/testsuite/tests/typecheck/should_compile/T7903.stderr
index 7020e1c0e5..efffb2e8ad 100644
--- a/testsuite/tests/typecheck/should_compile/T7903.stderr
+++ b/testsuite/tests/typecheck/should_compile/T7903.stderr
@@ -1,10 +1,10 @@
-T7903.hs:6:10: Warning:
- No explicit implementation for
- either ‘==’ or ‘/=’
- In the instance declaration for ‘Eq (a -> b)’
+T7903.hs:6:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ either ‘==’ or ‘/=’
+ • In the instance declaration for ‘Eq (a -> b)’
-T7903.hs:7:10: Warning:
- No explicit implementation for
- either ‘compare’ or ‘<=’
- In the instance declaration for ‘Ord (a -> b)’
+T7903.hs:7:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ either ‘compare’ or ‘<=’
+ • In the instance declaration for ‘Ord (a -> b)’
diff --git a/testsuite/tests/typecheck/should_compile/T9497a.stderr b/testsuite/tests/typecheck/should_compile/T9497a.stderr
index ca22451023..ddbb5b93f6 100644
--- a/testsuite/tests/typecheck/should_compile/T9497a.stderr
+++ b/testsuite/tests/typecheck/should_compile/T9497a.stderr
@@ -1,5 +1,5 @@
-T9497a.hs:2:8: warning:
+T9497a.hs:2:8: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _main :: IO ()
Or perhaps ‘_main’ is mis-spelled, or not in scope
• In the expression: _main
diff --git a/testsuite/tests/typecheck/should_compile/holes.stderr b/testsuite/tests/typecheck/should_compile/holes.stderr
index 8551f66c3b..0d0582d126 100644
--- a/testsuite/tests/typecheck/should_compile/holes.stderr
+++ b/testsuite/tests/typecheck/should_compile/holes.stderr
@@ -1,5 +1,5 @@
-holes.hs:3:5: warning:
+holes.hs:3:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: t
Where: ‘t’ is a rigid type variable bound by
the inferred type of f :: t at holes.hs:3:1
@@ -7,7 +7,7 @@ holes.hs:3:5: warning:
In an equation for ‘f’: f = _
• Relevant bindings include f :: t (bound at holes.hs:3:1)
-holes.hs:6:7: warning:
+holes.hs:6:7: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: Char
• In the expression: _
In an equation for ‘g’: g x = _
@@ -15,14 +15,14 @@ holes.hs:6:7: warning:
x :: Int (bound at holes.hs:6:3)
g :: Int -> Char (bound at holes.hs:6:1)
-holes.hs:8:5: warning:
+holes.hs:8:5: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: [Char]
• In the first argument of ‘(++)’, namely ‘_’
In the expression: _ ++ "a"
In an equation for ‘h’: h = _ ++ "a"
• Relevant bindings include h :: [Char] (bound at holes.hs:8:1)
-holes.hs:11:15: warning:
+holes.hs:11:15: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: b0
Where: ‘b0’ is an ambiguous type variable
• In the second argument of ‘const’, namely ‘_’
diff --git a/testsuite/tests/typecheck/should_compile/holes2.stderr b/testsuite/tests/typecheck/should_compile/holes2.stderr
index 08d1b466d1..51c4da9562 100644
--- a/testsuite/tests/typecheck/should_compile/holes2.stderr
+++ b/testsuite/tests/typecheck/should_compile/holes2.stderr
@@ -13,7 +13,7 @@ holes2.hs:3:5: warning:
• In the expression: show _
In an equation for ‘f’: f = show _
-holes2.hs:3:10: warning:
+holes2.hs:3:10: warning: [-Wtyped-holes (in -Wdefault)]
• Found hole: _ :: a0
Where: ‘a0’ is an ambiguous type variable
• In the first argument of ‘show’, namely ‘_’
diff --git a/testsuite/tests/typecheck/should_compile/tc078.stderr b/testsuite/tests/typecheck/should_compile/tc078.stderr
index fa9d3acd2e..453ad780e0 100644
--- a/testsuite/tests/typecheck/should_compile/tc078.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc078.stderr
@@ -1,10 +1,10 @@
-tc078.hs:9:10: Warning:
- No explicit implementation for
- either ‘==’ or ‘/=’
- In the instance declaration for ‘Eq (Bar a)’
+tc078.hs:9:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ either ‘==’ or ‘/=’
+ • In the instance declaration for ‘Eq (Bar a)’
-tc078.hs:10:10: Warning:
- No explicit implementation for
- either ‘compare’ or ‘<=’
- In the instance declaration for ‘Ord (Bar a)’
+tc078.hs:10:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ either ‘compare’ or ‘<=’
+ • In the instance declaration for ‘Ord (Bar a)’
diff --git a/testsuite/tests/typecheck/should_compile/tc115.stderr b/testsuite/tests/typecheck/should_compile/tc115.stderr
index 4f7981ac56..449e4cdbe8 100644
--- a/testsuite/tests/typecheck/should_compile/tc115.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc115.stderr
@@ -1,5 +1,5 @@
-tc115.hs:13:10: Warning:
- No explicit implementation for
- ‘foo’
- In the instance declaration for ‘Foo [m a] (m a)’
+tc115.hs:13:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ ‘foo’
+ • In the instance declaration for ‘Foo [m a] (m a)’
diff --git a/testsuite/tests/typecheck/should_compile/tc116.stderr b/testsuite/tests/typecheck/should_compile/tc116.stderr
index 074a795956..d4de632323 100644
--- a/testsuite/tests/typecheck/should_compile/tc116.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc116.stderr
@@ -1,5 +1,5 @@
-tc116.hs:13:10: Warning:
- No explicit implementation for
- ‘foo’
- In the instance declaration for ‘Foo [m a] (m a)’
+tc116.hs:13:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ ‘foo’
+ • In the instance declaration for ‘Foo [m a] (m a)’
diff --git a/testsuite/tests/typecheck/should_compile/tc125.stderr b/testsuite/tests/typecheck/should_compile/tc125.stderr
index d57cda2b19..b1136b602c 100644
--- a/testsuite/tests/typecheck/should_compile/tc125.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc125.stderr
@@ -1,25 +1,26 @@
-tc125.hs:17:10: Warning:
- No explicit implementation for
- ‘add’
- In the instance declaration for ‘Add Z a a’
+tc125.hs:17:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ ‘add’
+ • In the instance declaration for ‘Add Z a a’
-tc125.hs:18:10: Warning:
- No explicit implementation for
- ‘add’
- In the instance declaration for ‘Add (S a) b (S c)’
+tc125.hs:18:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ ‘add’
+ • In the instance declaration for ‘Add (S a) b (S c)’
-tc125.hs:22:10: Warning:
- No explicit implementation for
- ‘mul’
- In the instance declaration for ‘Mul Z a Z’
+tc125.hs:22:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ ‘mul’
+ • In the instance declaration for ‘Mul Z a Z’
-tc125.hs:23:10: Warning:
- No explicit implementation for
- ‘mul’
- In the instance declaration for ‘Mul (S a) b d’
+tc125.hs:23:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ ‘mul’
+ • In the instance declaration for ‘Mul (S a) b d’
-tc125.hs:30:10: Warning:
- No explicit implementation for
- ‘add’
- In the instance declaration for ‘Add (Q a b) (Q c d) (Q ad_bc bd)’
+tc125.hs:30:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ ‘add’
+ • In the instance declaration for
+ ‘Add (Q a b) (Q c d) (Q ad_bc bd)’
diff --git a/testsuite/tests/typecheck/should_compile/tc126.stderr b/testsuite/tests/typecheck/should_compile/tc126.stderr
index 3c766d813e..6ccb8d6b25 100644
--- a/testsuite/tests/typecheck/should_compile/tc126.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc126.stderr
@@ -1,10 +1,10 @@
-tc126.hs:16:25: Warning:
- No explicit implementation for
- ‘bug’
- In the instance declaration for ‘Bug (Int -> r) Int r’
+tc126.hs:16:25: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ ‘bug’
+ • In the instance declaration for ‘Bug (Int -> r) Int r’
-tc126.hs:17:10: Warning:
- No explicit implementation for
- ‘bug’
- In the instance declaration for ‘Bug f (c a) (c r)’
+tc126.hs:17:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ ‘bug’
+ • In the instance declaration for ‘Bug f (c a) (c r)’
diff --git a/testsuite/tests/typecheck/should_compile/tc161.stderr b/testsuite/tests/typecheck/should_compile/tc161.stderr
index 163fde19cd..6140a7cac1 100644
--- a/testsuite/tests/typecheck/should_compile/tc161.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc161.stderr
@@ -1,5 +1,5 @@
-tc161.hs:17:10: Warning:
- No explicit implementation for
- ‘op’
- In the instance declaration for ‘Foo Int’
+tc161.hs:17:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ ‘op’
+ • In the instance declaration for ‘Foo Int’
diff --git a/testsuite/tests/typecheck/should_compile/tc175.stderr b/testsuite/tests/typecheck/should_compile/tc175.stderr
index b7a0eedb68..57959c1396 100644
--- a/testsuite/tests/typecheck/should_compile/tc175.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc175.stderr
@@ -1,5 +1,5 @@
-tc175.hs:13:10: Warning:
- No explicit implementation for
- either ‘showsPrec’ or ‘show’
- In the instance declaration for ‘Show (a -> b)’
+tc175.hs:13:10: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit implementation for
+ either ‘showsPrec’ or ‘show’
+ • In the instance declaration for ‘Show (a -> b)’
diff --git a/testsuite/tests/typecheck/should_compile/tc243.stderr b/testsuite/tests/typecheck/should_compile/tc243.stderr
index 0219817408..f96fede5e6 100644
--- a/testsuite/tests/typecheck/should_compile/tc243.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc243.stderr
@@ -1,3 +1,3 @@
-tc243.hs:10:1: warning:
+tc243.hs:10:1: warning: [-Wmissing-signatures (in -Wall)]
Top-level binding with no type signature: (.+.) :: forall a. a
diff --git a/testsuite/tests/typecheck/should_compile/tc254.stderr b/testsuite/tests/typecheck/should_compile/tc254.stderr
index 885b505828..663279d71a 100644
--- a/testsuite/tests/typecheck/should_compile/tc254.stderr
+++ b/testsuite/tests/typecheck/should_compile/tc254.stderr
@@ -1,4 +1,4 @@
-tc254.hs:8:1: Warning:
- No explicit associated type or default declaration for ‘Typ’
- In the instance declaration for ‘Cls Int’
+tc254.hs:8:1: warning: [-Wmissing-methods (in -Wdefault)]
+ • No explicit associated type or default declaration for ‘Typ’
+ • In the instance declaration for ‘Cls Int’
diff --git a/testsuite/tests/typecheck/should_fail/T5051.stderr b/testsuite/tests/typecheck/should_fail/T5051.stderr
index 2ad01e86ba..83a9ac8aef 100644
--- a/testsuite/tests/typecheck/should_fail/T5051.stderr
+++ b/testsuite/tests/typecheck/should_fail/T5051.stderr
@@ -1,5 +1,5 @@
-T5051.hs:8:30: warning:
+T5051.hs:8:30: warning: [-Wmissing-methods (in -Wdefault)]
• No explicit implementation for
either ‘==’ or ‘/=’
• In the instance declaration for ‘Eq [T]’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail204.stderr b/testsuite/tests/typecheck/should_fail/tcfail204.stderr
index f4b6ec791b..f3326faf0e 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail204.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail204.stderr
@@ -1,5 +1,5 @@
-tcfail204.hs:10:15: warning:
+tcfail204.hs:10:15: warning: [-Wtype-defaults (in -Wall)]
• Defaulting the following constraints to type ‘Double’
(Fractional a0)
arising from the literal ‘6.3’ at tcfail204.hs:10:15-17