summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorAlfredo Di Napoli <alfredo@well-typed.com>2021-05-11 11:27:34 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-03 15:58:33 -0400
commitd5b89ed4d3c444e8bc4fe7cbbee38f9766574b84 (patch)
tree85810c3cabe578c1bdca32e92b9eca87bea2c116 /testsuite
parent25977ab542a30df4ae71d9699d015bcdd1ab7cfb (diff)
downloadhaskell-d5b89ed4d3c444e8bc4fe7cbbee38f9766574b84.tar.gz
Port HsToCore messages to new infrastructure
This commit converts a bunch of HsToCore (Ds) messages to use the new GHC's diagnostic message infrastructure. In particular the DsMessage type has been expanded with a lot of type constructors, each encapsulating a particular error and warning emitted during desugaring. Due to the fact that levity polymorphism checking can happen both at the Ds and at the TcRn level, a new `TcLevityCheckDsMessage` constructor has been added to the `TcRnMessage` type.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/deSugar/should_compile/T10662.stderr5
-rw-r--r--testsuite/tests/deSugar/should_compile/T3263-1.stderr6
-rw-r--r--testsuite/tests/deSugar/should_compile/T3263-2.stderr6
-rw-r--r--testsuite/tests/driver/recomp005/recomp005.stderr6
-rw-r--r--testsuite/tests/ghci/scripts/T3263.stderr3
-rw-r--r--testsuite/tests/ghci/scripts/T9140.stdout4
-rw-r--r--testsuite/tests/numeric/should_compile/T8542.stderr3
-rw-r--r--testsuite/tests/parser/should_run/CountAstDeps.stdout10
-rw-r--r--testsuite/tests/parser/should_run/CountParserDeps.stdout10
-rw-r--r--testsuite/tests/pmcheck/should_compile/T11822.stderr3
-rw-r--r--testsuite/tests/pmcheck/should_compile/TooManyDeltas.stderr6
-rw-r--r--testsuite/tests/rename/should_compile/T2600.stderr6
-rw-r--r--testsuite/tests/simplCore/should_compile/T6082-RULE.stderr6
-rw-r--r--testsuite/tests/simplCore/should_compile/T7287.stderr3
-rw-r--r--testsuite/tests/typecheck/should_fail/T6078.stderr2
15 files changed, 56 insertions, 23 deletions
diff --git a/testsuite/tests/deSugar/should_compile/T10662.stderr b/testsuite/tests/deSugar/should_compile/T10662.stderr
index 6a5cc457fc..e1f8c75c17 100644
--- a/testsuite/tests/deSugar/should_compile/T10662.stderr
+++ b/testsuite/tests/deSugar/should_compile/T10662.stderr
@@ -1,5 +1,6 @@
T10662.hs:3:3: warning: [-Wunused-do-bind (in -Wall)]
A do-notation statement discarded a result of type ‘String’
- Suppress this warning by saying
- ‘_ <- return $ let a = "hello" in a’
+ Suggested fix:
+ Suppress this warning by saying
+ ‘_ <- return $ let a = "hello" in a’
diff --git a/testsuite/tests/deSugar/should_compile/T3263-1.stderr b/testsuite/tests/deSugar/should_compile/T3263-1.stderr
index a50f8933aa..acc59ab3cd 100644
--- a/testsuite/tests/deSugar/should_compile/T3263-1.stderr
+++ b/testsuite/tests/deSugar/should_compile/T3263-1.stderr
@@ -1,8 +1,10 @@
T3263-1.hs:25:3: warning: [-Wunused-do-bind (in -Wall)]
A do-notation statement discarded a result of type ‘Int’
- Suppress this warning by saying ‘_ <- nonNullM’
+ Suggested fix:
+ Suppress this warning by saying ‘_ <- nonNullM’
T3263-1.hs:35:3: warning: [-Wunused-do-bind (in -Wall)]
A do-notation statement discarded a result of type ‘Int’
- Suppress this warning by saying ‘_ <- nonNullM’
+ Suggested fix:
+ Suppress this warning by saying ‘_ <- nonNullM’
diff --git a/testsuite/tests/deSugar/should_compile/T3263-2.stderr b/testsuite/tests/deSugar/should_compile/T3263-2.stderr
index 83de241f50..32c3bc3ad8 100644
--- a/testsuite/tests/deSugar/should_compile/T3263-2.stderr
+++ b/testsuite/tests/deSugar/should_compile/T3263-2.stderr
@@ -1,8 +1,10 @@
T3263-2.hs:25:3: warning: [-Wwrong-do-bind (in -Wdefault)]
A do-notation statement discarded a result of type ‘m Int’
- Suppress this warning by saying ‘_ <- return (return 10 :: m Int)’
+ Suggested fix:
+ Suppress this warning by saying ‘_ <- return (return 10 :: m Int)’
T3263-2.hs:37:3: warning: [-Wwrong-do-bind (in -Wdefault)]
A do-notation statement discarded a result of type ‘m Int’
- Suppress this warning by saying ‘_ <- return (return 10 :: m Int)’
+ Suggested fix:
+ Suppress this warning by saying ‘_ <- return (return 10 :: m Int)’
diff --git a/testsuite/tests/driver/recomp005/recomp005.stderr b/testsuite/tests/driver/recomp005/recomp005.stderr
index f1c81418a2..9a966f977b 100644
--- a/testsuite/tests/driver/recomp005/recomp005.stderr
+++ b/testsuite/tests/driver/recomp005/recomp005.stderr
@@ -1,9 +1,11 @@
C.hs:7:11: warning: [-Winline-rule-shadowing (in -Wdefault)]
Rule "f/g" may never fire because ‘g’ might inline first
- Probable fix: add an INLINE[n] or NOINLINE[n] pragma for ‘g’
+ Suggested fix:
+ Add an INLINE[n] or NOINLINE[n] pragma for ‘g’
C.hs:7:11: warning: [-Winline-rule-shadowing (in -Wdefault)]
Rule "f/g" may never fire because ‘f’ might inline first
- Probable fix: add an INLINE[n] or NOINLINE[n] pragma for ‘f’
+ Suggested fix:
+ Add an INLINE[n] or NOINLINE[n] pragma for ‘f’
diff --git a/testsuite/tests/ghci/scripts/T3263.stderr b/testsuite/tests/ghci/scripts/T3263.stderr
index df58a5dc58..dd72b3f31b 100644
--- a/testsuite/tests/ghci/scripts/T3263.stderr
+++ b/testsuite/tests/ghci/scripts/T3263.stderr
@@ -1,4 +1,5 @@
T3263.hs:8:12: warning: [-Wunused-do-bind (in -Wall)]
A do-notation statement discarded a result of type ‘Char’
- Suppress this warning by saying ‘_ <- getChar’
+ Suggested fix:
+ Suppress this warning by saying ‘_ <- getChar’
diff --git a/testsuite/tests/ghci/scripts/T9140.stdout b/testsuite/tests/ghci/scripts/T9140.stdout
index 85406d04b6..584803afbc 100644
--- a/testsuite/tests/ghci/scripts/T9140.stdout
+++ b/testsuite/tests/ghci/scripts/T9140.stdout
@@ -1,11 +1,11 @@
<interactive>:2:5: error:
You can't mix polymorphic and unlifted bindings: a = (# 1 #)
- Probable fix: add a type signature
+ Suggested fix: Add a type signature.
<interactive>:3:5: error:
You can't mix polymorphic and unlifted bindings: a = (# 1, 3 #)
- Probable fix: add a type signature
+ Suggested fix: Add a type signature.
<interactive>:1:1: error:
GHCi can't bind a variable of unlifted type:
diff --git a/testsuite/tests/numeric/should_compile/T8542.stderr b/testsuite/tests/numeric/should_compile/T8542.stderr
index 699ba5d573..fb6ddf7a72 100644
--- a/testsuite/tests/numeric/should_compile/T8542.stderr
+++ b/testsuite/tests/numeric/should_compile/T8542.stderr
@@ -1,4 +1,5 @@
T8542.hs:9:5: warning: [-Woverflowed-literals (in -Wdefault)]
Literal 128 is out of the Int8 range -128..127
- If you are trying to write a large negative literal, use NegativeLiterals
+ Suggested fix:
+ If you are trying to write a large negative literal, use NegativeLiterals
diff --git a/testsuite/tests/parser/should_run/CountAstDeps.stdout b/testsuite/tests/parser/should_run/CountAstDeps.stdout
index d17ccda974..4b33ad2982 100644
--- a/testsuite/tests/parser/should_run/CountAstDeps.stdout
+++ b/testsuite/tests/parser/should_run/CountAstDeps.stdout
@@ -1,4 +1,4 @@
-Found 258 Language.Haskell.Syntax module dependencies
+Found 266 Language.Haskell.Syntax module dependencies
GHC.Builtin.Names
GHC.Builtin.PrimOps
GHC.Builtin.Types
@@ -31,6 +31,7 @@ GHC.Core.FamInstEnv
GHC.Core.InstEnv
GHC.Core.Lint
GHC.Core.Make
+GHC.Core.Map.Expr
GHC.Core.Map.Type
GHC.Core.Multiplicity
GHC.Core.Opt.Arity
@@ -108,6 +109,9 @@ GHC.Hs.Type
GHC.Hs.Utils
GHC.HsToCore.Errors.Ppr
GHC.HsToCore.Errors.Types
+GHC.HsToCore.Pmc.Ppr
+GHC.HsToCore.Pmc.Solver.Types
+GHC.HsToCore.Pmc.Types
GHC.Iface.Ext.Fields
GHC.Iface.Recomp.Binary
GHC.Iface.Syntax
@@ -148,6 +152,8 @@ GHC.SysTools.Terminal
GHC.Tc.Errors.Hole.FitTypes
GHC.Tc.Errors.Ppr
GHC.Tc.Errors.Types
+GHC.Tc.Solver.InertSet
+GHC.Tc.Solver.Types
GHC.Tc.Types
GHC.Tc.Types.Constraint
GHC.Tc.Types.Evidence
@@ -168,6 +174,7 @@ GHC.Types.Fixity.Env
GHC.Types.ForeignCall
GHC.Types.ForeignStubs
GHC.Types.Hint
+GHC.Types.Hint.Ppr
GHC.Types.HpcInfo
GHC.Types.IPE
GHC.Types.Id
@@ -197,6 +204,7 @@ GHC.Types.Unique.DFM
GHC.Types.Unique.DSet
GHC.Types.Unique.FM
GHC.Types.Unique.Map
+GHC.Types.Unique.SDFM
GHC.Types.Unique.Set
GHC.Types.Unique.Supply
GHC.Types.Var
diff --git a/testsuite/tests/parser/should_run/CountParserDeps.stdout b/testsuite/tests/parser/should_run/CountParserDeps.stdout
index c9080fbce3..16dbb8e185 100644
--- a/testsuite/tests/parser/should_run/CountParserDeps.stdout
+++ b/testsuite/tests/parser/should_run/CountParserDeps.stdout
@@ -1,4 +1,4 @@
-Found 264 GHC.Parser module dependencies
+Found 272 GHC.Parser module dependencies
GHC.Builtin.Names
GHC.Builtin.PrimOps
GHC.Builtin.Types
@@ -31,6 +31,7 @@ GHC.Core.FamInstEnv
GHC.Core.InstEnv
GHC.Core.Lint
GHC.Core.Make
+GHC.Core.Map.Expr
GHC.Core.Map.Type
GHC.Core.Multiplicity
GHC.Core.Opt.Arity
@@ -109,6 +110,9 @@ GHC.Hs.Type
GHC.Hs.Utils
GHC.HsToCore.Errors.Ppr
GHC.HsToCore.Errors.Types
+GHC.HsToCore.Pmc.Ppr
+GHC.HsToCore.Pmc.Solver.Types
+GHC.HsToCore.Pmc.Types
GHC.Iface.Ext.Fields
GHC.Iface.Recomp.Binary
GHC.Iface.Syntax
@@ -154,6 +158,8 @@ GHC.SysTools.Terminal
GHC.Tc.Errors.Hole.FitTypes
GHC.Tc.Errors.Ppr
GHC.Tc.Errors.Types
+GHC.Tc.Solver.InertSet
+GHC.Tc.Solver.Types
GHC.Tc.Types
GHC.Tc.Types.Constraint
GHC.Tc.Types.Evidence
@@ -174,6 +180,7 @@ GHC.Types.Fixity.Env
GHC.Types.ForeignCall
GHC.Types.ForeignStubs
GHC.Types.Hint
+GHC.Types.Hint.Ppr
GHC.Types.HpcInfo
GHC.Types.IPE
GHC.Types.Id
@@ -203,6 +210,7 @@ GHC.Types.Unique.DFM
GHC.Types.Unique.DSet
GHC.Types.Unique.FM
GHC.Types.Unique.Map
+GHC.Types.Unique.SDFM
GHC.Types.Unique.Set
GHC.Types.Unique.Supply
GHC.Types.Var
diff --git a/testsuite/tests/pmcheck/should_compile/T11822.stderr b/testsuite/tests/pmcheck/should_compile/T11822.stderr
index 8ad52e6de4..212d300537 100644
--- a/testsuite/tests/pmcheck/should_compile/T11822.stderr
+++ b/testsuite/tests/pmcheck/should_compile/T11822.stderr
@@ -19,5 +19,6 @@ T11822.hs:33:1: warning:
• Redundant clauses might not be reported at all
• Redundant clauses might be reported as inaccessible
• Patterns reported as unmatched might actually be matched
- Increase the limit or resolve the warnings to suppress this message.
+ Suggested fix:
+ Increase the limit or resolve the warnings to suppress this message.
diff --git a/testsuite/tests/pmcheck/should_compile/TooManyDeltas.stderr b/testsuite/tests/pmcheck/should_compile/TooManyDeltas.stderr
index cb65b8cab4..9297e1b669 100644
--- a/testsuite/tests/pmcheck/should_compile/TooManyDeltas.stderr
+++ b/testsuite/tests/pmcheck/should_compile/TooManyDeltas.stderr
@@ -13,14 +13,16 @@ TooManyDeltas.hs:14:1: warning:
• Redundant clauses might not be reported at all
• Redundant clauses might be reported as inaccessible
• Patterns reported as unmatched might actually be matched
- Increase the limit or resolve the warnings to suppress this message.
+ Suggested fix:
+ Increase the limit or resolve the warnings to suppress this message.
TooManyDeltas.hs:19:1: warning:
Pattern match checker ran into -fmax-pmcheck-models=0 limit, so
• Redundant clauses might not be reported at all
• Redundant clauses might be reported as inaccessible
• Patterns reported as unmatched might actually be matched
- Increase the limit or resolve the warnings to suppress this message.
+ Suggested fix:
+ Increase the limit or resolve the warnings to suppress this message.
TooManyDeltas.hs:20:1: warning: [-Woverlapping-patterns (in -Wdefault)]
Pattern match has inaccessible right hand side
diff --git a/testsuite/tests/rename/should_compile/T2600.stderr b/testsuite/tests/rename/should_compile/T2600.stderr
index ca675475cf..64ef6e9e82 100644
--- a/testsuite/tests/rename/should_compile/T2600.stderr
+++ b/testsuite/tests/rename/should_compile/T2600.stderr
@@ -2,10 +2,12 @@
T2600.hs:16:1: warning: [-Winline-rule-shadowing (in -Wdefault)]
Rule "myrule" may never fire
because rule "Class op to" for ‘to’ might fire first
- Probable fix: add phase [n] or [~n] to the competing rule
+ Suggested fix:
+ Add phase [n] or [~n] to the competing rule
T2600.hs:16:1: warning: [-Winline-rule-shadowing (in -Wdefault)]
Rule "myrule" may never fire
because rule "Class op tmap" for ‘tmap’ might fire first
- Probable fix: add phase [n] or [~n] to the competing rule
+ Suggested fix:
+ Add phase [n] or [~n] to the competing rule
diff --git a/testsuite/tests/simplCore/should_compile/T6082-RULE.stderr b/testsuite/tests/simplCore/should_compile/T6082-RULE.stderr
index 7359861750..3a3332769e 100644
--- a/testsuite/tests/simplCore/should_compile/T6082-RULE.stderr
+++ b/testsuite/tests/simplCore/should_compile/T6082-RULE.stderr
@@ -1,8 +1,10 @@
T6082-RULE.hs:5:11: warning: [-Winline-rule-shadowing (in -Wdefault)]
Rule "foo1" may never fire because ‘foo1’ might inline first
- Probable fix: add an INLINE[n] or NOINLINE[n] pragma for ‘foo1’
+ Suggested fix:
+ Add an INLINE[n] or NOINLINE[n] pragma for ‘foo1’
T6082-RULE.hs:10:11: warning: [-Winline-rule-shadowing (in -Wdefault)]
Rule "foo2" may never fire because ‘foo2’ might inline first
- Probable fix: add an INLINE[n] or NOINLINE[n] pragma for ‘foo2’
+ Suggested fix:
+ Add an INLINE[n] or NOINLINE[n] pragma for ‘foo2’
diff --git a/testsuite/tests/simplCore/should_compile/T7287.stderr b/testsuite/tests/simplCore/should_compile/T7287.stderr
index 5aa71e0e98..957282b8f3 100644
--- a/testsuite/tests/simplCore/should_compile/T7287.stderr
+++ b/testsuite/tests/simplCore/should_compile/T7287.stderr
@@ -2,4 +2,5 @@
T7287.hs:7:3: warning: [-Winline-rule-shadowing (in -Wdefault)]
Rule "int2Word#/word2Int#" may never fire
because rule "word2Int#" for ‘word2Int#’ might fire first
- Probable fix: add phase [n] or [~n] to the competing rule
+ Suggested fix:
+ Add phase [n] or [~n] to the competing rule
diff --git a/testsuite/tests/typecheck/should_fail/T6078.stderr b/testsuite/tests/typecheck/should_fail/T6078.stderr
index 62a4210443..65f5df765e 100644
--- a/testsuite/tests/typecheck/should_fail/T6078.stderr
+++ b/testsuite/tests/typecheck/should_fail/T6078.stderr
@@ -2,4 +2,4 @@
T6078.hs:8:10: error:
You can't mix polymorphic and unlifted bindings:
ip1p@(Ptr ip1) = Ptr ip0 `plusPtr` len
- Probable fix: add a type signature
+ Suggested fix: Add a type signature.