Commit 3cd4c9ca authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺

Annotate `[-Wdeferred-type-errors]` in warnings (re #10752)

This was missed in bb5afd3c
parent b6c61e37
......@@ -624,7 +624,7 @@ maybeReportError ctxt err
| otherwise
= case cec_defer_type_errors ctxt of
TypeDefer -> return ()
TypeWarn -> reportWarning NoReason err
TypeWarn -> reportWarning (Reason Opt_WarnDeferredTypeErrors) err
TypeError -> reportError err
addDeferredBinding :: ReportErrCtxt -> ErrMsg -> Ct -> TcM ()
......
......@@ -3,7 +3,7 @@ T7294.hs:25:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match is redundant
In an equation for ‘nth’: nth Nil _ = ...
T7294.hs:25:5: warning:
T7294.hs:25:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match type ‘'True’ with ‘'False’
Inaccessible code in
a pattern with constructor: Nil :: forall a. Vec a 'Zero,
......
../../typecheck/should_run/Defer01.hs:11:40: warning:
../../typecheck/should_run/Defer01.hs:11:40: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match type ‘Char’ with ‘[Char]’
Expected type: String
Actual type: Char
......@@ -7,12 +7,12 @@
In the second argument of ‘(>>)’, namely ‘putStr ','’
In the expression: putStr "Hello World" >> putStr ','
../../typecheck/should_run/Defer01.hs:14:5: warning:
../../typecheck/should_run/Defer01.hs:14:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match expected type ‘Int’ with actual type ‘Char’
• In the expression: 'p'
In an equation for ‘a’: a = 'p'
../../typecheck/should_run/Defer01.hs:18:7: warning:
../../typecheck/should_run/Defer01.hs:18:7: warning: [-Wdeferred-type-errors (in -Wdefault)]
• No instance for (Eq B) arising from a use of ‘==’
• In the expression: x == x
In an equation for ‘b’: b x = x == x
......@@ -21,7 +21,7 @@
Pattern match has inaccessible right hand side
In an equation for ‘c’: c (C2 x) = ...
../../typecheck/should_run/Defer01.hs:25:4: warning:
../../typecheck/should_run/Defer01.hs:25:4: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match type ‘Int’ with ‘Bool’
Inaccessible code in
a pattern with constructor: C2 :: Bool -> C Bool,
......@@ -29,13 +29,13 @@
• In the pattern: C2 x
In an equation for ‘c’: c (C2 x) = True
../../typecheck/should_run/Defer01.hs:28:5: warning:
../../typecheck/should_run/Defer01.hs:28:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
• No instance for (Num (a -> a)) arising from the literal ‘1’
(maybe you haven't applied a function to enough arguments?)
• In the expression: 1
In an equation for ‘d’: d = 1
../../typecheck/should_run/Defer01.hs:31:5: warning:
../../typecheck/should_run/Defer01.hs:31:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match expected type ‘Char -> t’ with actual type ‘Char’
• The function ‘e’ is applied to one argument,
but its type ‘Char’ has none
......@@ -44,7 +44,7 @@
• Relevant bindings include
f :: t (bound at ../../typecheck/should_run/Defer01.hs:31:1)
../../typecheck/should_run/Defer01.hs:34:8: warning:
../../typecheck/should_run/Defer01.hs:34:8: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match expected type ‘Char’ with actual type ‘a’
‘a’ is a rigid type variable bound by
the type signature for:
......@@ -58,7 +58,7 @@
h :: a -> (Char, Char)
(bound at ../../typecheck/should_run/Defer01.hs:34:1)
../../typecheck/should_run/Defer01.hs:39:17: warning:
../../typecheck/should_run/Defer01.hs:39:17: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match expected type ‘Bool’ with actual type ‘T a’
• In the first argument of ‘not’, namely ‘(K a)’
In the expression: (not (K a))
......@@ -67,12 +67,12 @@
a :: a (bound at ../../typecheck/should_run/Defer01.hs:39:3)
i :: a -> () (bound at ../../typecheck/should_run/Defer01.hs:39:1)
../../typecheck/should_run/Defer01.hs:43:5: warning:
../../typecheck/should_run/Defer01.hs:43:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
• No instance for (MyClass a1) arising from a use of ‘myOp’
• In the expression: myOp 23
In an equation for ‘j’: j = myOp 23
../../typecheck/should_run/Defer01.hs:43:10: warning:
../../typecheck/should_run/Defer01.hs:43:10: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Ambiguous type variable ‘a1’ arising from the literal ‘23’
prevents the constraint ‘(Num a1)’ from being solved.
Probable fix: use a type annotation to specify what ‘a1’ should be.
......@@ -86,13 +86,13 @@
In the expression: myOp 23
In an equation for ‘j’: j = myOp 23
../../typecheck/should_run/Defer01.hs:45:1: warning:
../../typecheck/should_run/Defer01.hs:45:1: warning: [-Wdeferred-type-errors (in -Wdefault)]
Couldn't match type ‘Int’ with ‘Bool’
Inaccessible code in
the type signature for:
k :: (Int ~ Bool) => Int -> Bool
../../typecheck/should_run/Defer01.hs:45:6: warning:
../../typecheck/should_run/Defer01.hs:45:6: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match type ‘Int’ with ‘Bool’
Inaccessible code in
the type signature for:
......@@ -106,7 +106,7 @@
Pattern match is redundant
In an equation for ‘k’: k x = ...
../../typecheck/should_run/Defer01.hs:49:5: warning:
../../typecheck/should_run/Defer01.hs:49:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match expected type ‘IO a0’
with actual type ‘Char -> IO ()’
• Probable cause: ‘putChar’ is applied to too few arguments
......
Defer03.hs:4:5: warning:
Defer03.hs:4:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match expected type ‘Int’ with actual type ‘Char’
• In the expression: 'p'
In an equation for ‘a’: a = 'p'
......@@ -21,7 +21,7 @@ Defer03.hs:7:5: error:
In an equation for ‘f’: f = _
• Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
Defer03.hs:4:5: warning:
Defer03.hs:4:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match expected type ‘Int’ with actual type ‘Char’
• In the expression: 'p'
In an equation for ‘a’: a = 'p'
......@@ -43,7 +43,7 @@ Defer03.hs:7:5: error:
In an equation for ‘f’: f = _
• Relevant bindings include f :: Int (bound at Defer03.hs:7:1)
Defer03.hs:4:5: warning:
Defer03.hs:4:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match expected type ‘Int’ with actual type ‘Char’
• In the expression: 'p'
In an equation for ‘a’: a = 'p'
......
......@@ -34,7 +34,7 @@ T10403.hs:19:7: warning: [-Wpartial-type-signatures (in -Wdefault)]
• Relevant bindings include
h2 :: (a -> b) -> f0 a -> H f0 (bound at T10403.hs:22:1)
T10403.hs:22:15: warning:
T10403.hs:22:15: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Ambiguous type variable ‘f0’ arising from a use of ‘fmap’
prevents the constraint ‘(Functor f0)’ from being solved.
Relevant bindings include
......@@ -51,7 +51,7 @@ T10403.hs:22:15: warning:
In the expression: H . fmap (const ())
In the expression: (H . fmap (const ())) (fmap f b)
T10403.hs:28:8: warning:
T10403.hs:28:8: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match type ‘f0’ with ‘B t’
because type variable ‘t’ would escape its scope
This (rigid, skolem) type variable is bound by
......@@ -65,7 +65,7 @@ T10403.hs:28:8: warning:
• Relevant bindings include
app2 :: H (B t) (bound at T10403.hs:28:1)
T10403.hs:28:20: warning:
T10403.hs:28:20: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match type ‘f0’ with ‘B t’
because type variable ‘t’ would escape its scope
This (rigid, skolem) type variable is bound by
......
<interactive>:3:9: warning:
<interactive>:3:9: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match type ‘[Dec]’ with ‘Exp’
Expected type: Q Exp
Actual type: DecsQ
......
T11254.hs:16:10: warning:
T11254.hs:16:10: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match type ‘Frac Int’ with ‘Int’
arising from the superclasses of an instance declaration
• In the instance declaration for ‘ID Rational’
T11254.hs:18:12: warning:
T11254.hs:18:12: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match type ‘GHC.Real.Ratio Integer’ with ‘Int’
Expected type: Rational -> Frac Rational
Actual type: Rational -> Rational
......
T9834.hs:23:10: warning:
T9834.hs:23:10: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match type ‘p’ with ‘(->) (p a0)’
‘p’ is a rigid type variable bound by
the class declaration for ‘ApplicativeFix’ at T9834.hs:21:39
......@@ -20,7 +20,7 @@ T9834.hs:23:10: warning:
-> p a
(bound at T9834.hs:23:3)
T9834.hs:23:10: warning:
T9834.hs:23:10: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Couldn't match type ‘a’ with ‘a1’
‘a’ is a rigid type variable bound by
the type signature for:
......
holes2.hs:3:5: warning:
holes2.hs:3:5: warning: [-Wdeferred-type-errors (in -Wdefault)]
• Ambiguous type variable ‘a0’ arising from a use of ‘show’
prevents the constraint ‘(Show a0)’ from being solved.
Probable fix: use a type annotation to specify what ‘a0’ should be.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment