summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2017-10-24 13:56:29 -0400
committerBen Gamari <ben@smart-cactus.org>2017-10-25 15:45:34 -0400
commitbf83435b5c62776072977b9b1fc5aba2bffa97b4 (patch)
treeef9b3be38521fb4f9e972e1389d6ec9f199304ac
parent61f1b46e2a56fcb1e95dd1c4e87fb31940b3412d (diff)
downloadhaskell-bf83435b5c62776072977b9b1fc5aba2bffa97b4.tar.gz
typecheck: Clarify errors mentioned in #14385
-rw-r--r--compiler/typecheck/TcTyClsDecls.hs12
-rw-r--r--testsuite/tests/gadt/gadtSyntaxFail001.stderr2
-rw-r--r--testsuite/tests/gadt/gadtSyntaxFail002.stderr2
-rw-r--r--testsuite/tests/gadt/gadtSyntaxFail003.stderr2
-rw-r--r--testsuite/tests/ghci/scripts/T9293.stderr6
-rw-r--r--testsuite/tests/ghci/scripts/ghci057.stderr6
-rw-r--r--testsuite/tests/module/mod39.stderr2
-rw-r--r--testsuite/tests/parser/should_fail/readFail037.stderr8
-rw-r--r--testsuite/tests/parser/should_fail/readFail041.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/T12083a.stderr2
-rw-r--r--testsuite/tests/typecheck/should_fail/TcNoNullaryTC.stderr8
-rw-r--r--testsuite/tests/typecheck/should_fail/tcfail150.stderr2
12 files changed, 30 insertions, 30 deletions
diff --git a/compiler/typecheck/TcTyClsDecls.hs b/compiler/typecheck/TcTyClsDecls.hs
index 89fbca53e6..b4b31e3d50 100644
--- a/compiler/typecheck/TcTyClsDecls.hs
+++ b/compiler/typecheck/TcTyClsDecls.hs
@@ -2796,7 +2796,7 @@ checkFamFlag tc_name
; checkTc idx_tys err_msg }
where
err_msg = hang (text "Illegal family declaration for" <+> quotes (ppr tc_name))
- 2 (text "Use TypeFamilies to allow indexed type families")
+ 2 (text "Enable TypeFamilies to allow indexed type families")
{- Note [Class method constraints]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -3163,20 +3163,20 @@ classArityErr n cls
where
mkErr howMany allowWhat =
vcat [text (howMany ++ " parameters for class") <+> quotes (ppr cls),
- parens (text ("Use MultiParamTypeClasses to allow "
+ parens (text ("Enable MultiParamTypeClasses to allow "
++ allowWhat ++ " classes"))]
classFunDepsErr :: Class -> SDoc
classFunDepsErr cls
= vcat [text "Fundeps in class" <+> quotes (ppr cls),
- parens (text "Use FunctionalDependencies to allow fundeps")]
+ parens (text "Enable FunctionalDependencies to allow fundeps")]
badMethPred :: Id -> TcPredType -> SDoc
badMethPred sel_id pred
= vcat [ hang (text "Constraint" <+> quotes (ppr pred)
<+> text "in the type of" <+> quotes (ppr sel_id))
2 (text "constrains only the class type variables")
- , text "Use ConstrainedClassMethods to allow it" ]
+ , text "Enable ConstrainedClassMethods to allow it" ]
noClassTyVarErr :: Class -> TyCon -> SDoc
noClassTyVarErr clas fam_tc
@@ -3235,14 +3235,14 @@ badDataConTyCon data_con res_ty_tmpl actual_res_ty
badGadtDecl :: Name -> SDoc
badGadtDecl tc_name
= vcat [ text "Illegal generalised algebraic data declaration for" <+> quotes (ppr tc_name)
- , nest 2 (parens $ text "Use GADTs to allow GADTs") ]
+ , nest 2 (parens $ text "Enable the GADTs extension to allow this") ]
badExistential :: DataCon -> SDoc
badExistential con
= hang (text "Data constructor" <+> quotes (ppr con) <+>
text "has existential type variables, a context, or a specialised result type")
2 (vcat [ ppr con <+> dcolon <+> ppr (dataConUserType con)
- , parens $ text "Use ExistentialQuantification or GADTs to allow this" ])
+ , parens $ text "Enable ExistentialQuantification or GADTs to allow this" ])
badGADT :: DataCon -> [EqSpec] -> SDoc
badGADT con eq_specs
diff --git a/testsuite/tests/gadt/gadtSyntaxFail001.stderr b/testsuite/tests/gadt/gadtSyntaxFail001.stderr
index 248bc98044..9e3c0d4ffc 100644
--- a/testsuite/tests/gadt/gadtSyntaxFail001.stderr
+++ b/testsuite/tests/gadt/gadtSyntaxFail001.stderr
@@ -2,6 +2,6 @@
gadtSyntaxFail001.hs:8:5: error:
• Data constructor ‘C2’ has existential type variables, a context, or a specialised result type
C2 :: forall a. a -> Char -> Foo a Int
- (Use ExistentialQuantification or GADTs to allow this)
+ (Enable ExistentialQuantification or GADTs to allow this)
• In the definition of data constructor ‘C2’
In the data type declaration for ‘Foo’
diff --git a/testsuite/tests/gadt/gadtSyntaxFail002.stderr b/testsuite/tests/gadt/gadtSyntaxFail002.stderr
index 7c30b794f9..7b0251c7e1 100644
--- a/testsuite/tests/gadt/gadtSyntaxFail002.stderr
+++ b/testsuite/tests/gadt/gadtSyntaxFail002.stderr
@@ -2,6 +2,6 @@
gadtSyntaxFail002.hs:8:5: error:
• Data constructor ‘C2’ has existential type variables, a context, or a specialised result type
C2 :: forall a. a -> Char -> Foo a a
- (Use ExistentialQuantification or GADTs to allow this)
+ (Enable ExistentialQuantification or GADTs to allow this)
• In the definition of data constructor ‘C2’
In the data type declaration for ‘Foo’
diff --git a/testsuite/tests/gadt/gadtSyntaxFail003.stderr b/testsuite/tests/gadt/gadtSyntaxFail003.stderr
index a66d135c3a..903624499a 100644
--- a/testsuite/tests/gadt/gadtSyntaxFail003.stderr
+++ b/testsuite/tests/gadt/gadtSyntaxFail003.stderr
@@ -2,6 +2,6 @@
gadtSyntaxFail003.hs:7:5: error:
• Data constructor ‘C1’ has existential type variables, a context, or a specialised result type
C1 :: forall a c b. a -> Int -> c -> Foo b a
- (Use ExistentialQuantification or GADTs to allow this)
+ (Enable ExistentialQuantification or GADTs to allow this)
• In the definition of data constructor ‘C1’
In the data type declaration for ‘Foo’
diff --git a/testsuite/tests/ghci/scripts/T9293.stderr b/testsuite/tests/ghci/scripts/T9293.stderr
index 77cf2da0ec..4a72589688 100644
--- a/testsuite/tests/ghci/scripts/T9293.stderr
+++ b/testsuite/tests/ghci/scripts/T9293.stderr
@@ -1,19 +1,19 @@
<interactive>:4:1: error:
• Illegal generalised algebraic data declaration for ‘T’
- (Use GADTs to allow GADTs)
+ (Enable the GADTs extension to allow this)
• In the data declaration for ‘T’
ghci057.hs:3:3: error:
• Data constructor ‘C’ has existential type variables, a context, or a specialised result type
C :: T Int
- (Use ExistentialQuantification or GADTs to allow this)
+ (Enable ExistentialQuantification or GADTs to allow this)
• In the definition of data constructor ‘C’
In the data type declaration for ‘T’
ghci057.hs:3:3: error:
• Data constructor ‘C’ has existential type variables, a context, or a specialised result type
C :: T Int
- (Use ExistentialQuantification or GADTs to allow this)
+ (Enable ExistentialQuantification or GADTs to allow this)
• In the definition of data constructor ‘C’
In the data type declaration for ‘T’
diff --git a/testsuite/tests/ghci/scripts/ghci057.stderr b/testsuite/tests/ghci/scripts/ghci057.stderr
index 77cf2da0ec..4a72589688 100644
--- a/testsuite/tests/ghci/scripts/ghci057.stderr
+++ b/testsuite/tests/ghci/scripts/ghci057.stderr
@@ -1,19 +1,19 @@
<interactive>:4:1: error:
• Illegal generalised algebraic data declaration for ‘T’
- (Use GADTs to allow GADTs)
+ (Enable the GADTs extension to allow this)
• In the data declaration for ‘T’
ghci057.hs:3:3: error:
• Data constructor ‘C’ has existential type variables, a context, or a specialised result type
C :: T Int
- (Use ExistentialQuantification or GADTs to allow this)
+ (Enable ExistentialQuantification or GADTs to allow this)
• In the definition of data constructor ‘C’
In the data type declaration for ‘T’
ghci057.hs:3:3: error:
• Data constructor ‘C’ has existential type variables, a context, or a specialised result type
C :: T Int
- (Use ExistentialQuantification or GADTs to allow this)
+ (Enable ExistentialQuantification or GADTs to allow this)
• In the definition of data constructor ‘C’
In the data type declaration for ‘T’
diff --git a/testsuite/tests/module/mod39.stderr b/testsuite/tests/module/mod39.stderr
index 11aa05256e..95aaddbac5 100644
--- a/testsuite/tests/module/mod39.stderr
+++ b/testsuite/tests/module/mod39.stderr
@@ -2,6 +2,6 @@
mod39.hs:3:17: error:
• Constraint ‘Eq a’ in the type of ‘f’
constrains only the class type variables
- Use ConstrainedClassMethods to allow it
+ Enable ConstrainedClassMethods to allow it
• When checking the class method: f :: forall a. (C a, Eq a) => a
In the class declaration for ‘C’
diff --git a/testsuite/tests/parser/should_fail/readFail037.stderr b/testsuite/tests/parser/should_fail/readFail037.stderr
index 6fcd2db206..6b317eb051 100644
--- a/testsuite/tests/parser/should_fail/readFail037.stderr
+++ b/testsuite/tests/parser/should_fail/readFail037.stderr
@@ -1,5 +1,5 @@
-readFail037.hs:4:1:
- Too many parameters for class ‘Foo’
- (Use MultiParamTypeClasses to allow multi-parameter classes)
- In the class declaration for ‘Foo’
+readFail037.hs:4:1: error:
+ • Too many parameters for class ‘Foo’
+ (Enable MultiParamTypeClasses to allow multi-parameter classes)
+ • In the class declaration for ‘Foo’
diff --git a/testsuite/tests/parser/should_fail/readFail041.stderr b/testsuite/tests/parser/should_fail/readFail041.stderr
index c5b28a6f0f..028b96510b 100644
--- a/testsuite/tests/parser/should_fail/readFail041.stderr
+++ b/testsuite/tests/parser/should_fail/readFail041.stderr
@@ -1,5 +1,5 @@
-readFail041.hs:6:1:
- Fundeps in class ‘Foo’
- (Use FunctionalDependencies to allow fundeps)
- In the class declaration for ‘Foo’
+readFail041.hs:6:1: error:
+ • Fundeps in class ‘Foo’
+ (Enable FunctionalDependencies to allow fundeps)
+ • In the class declaration for ‘Foo’
diff --git a/testsuite/tests/typecheck/should_fail/T12083a.stderr b/testsuite/tests/typecheck/should_fail/T12083a.stderr
index dc1452da6f..910d4c35e4 100644
--- a/testsuite/tests/typecheck/should_fail/T12083a.stderr
+++ b/testsuite/tests/typecheck/should_fail/T12083a.stderr
@@ -7,6 +7,6 @@ T12083a.hs:5:1: error:
T12083a.hs:9:26: error:
• Data constructor ‘ExistentiallyLost’ has existential type variables, a context, or a specialised result type
ExistentiallyLost :: forall u. TC u => u -> ExistentiallyLost
- (Use ExistentialQuantification or GADTs to allow this)
+ (Enable ExistentialQuantification or GADTs to allow this)
• In the definition of data constructor ‘ExistentiallyLost’
In the data type declaration for ‘ExistentiallyLost’
diff --git a/testsuite/tests/typecheck/should_fail/TcNoNullaryTC.stderr b/testsuite/tests/typecheck/should_fail/TcNoNullaryTC.stderr
index 80f6ec4ec0..e41b8aa1bd 100644
--- a/testsuite/tests/typecheck/should_fail/TcNoNullaryTC.stderr
+++ b/testsuite/tests/typecheck/should_fail/TcNoNullaryTC.stderr
@@ -1,5 +1,5 @@
-TcNoNullaryTC.hs:3:1:
- No parameters for class ‘A’
- (Use MultiParamTypeClasses to allow no-parameter classes)
- In the class declaration for ‘A’
+TcNoNullaryTC.hs:3:1: error:
+ • No parameters for class ‘A’
+ (Enable MultiParamTypeClasses to allow no-parameter classes)
+ • In the class declaration for ‘A’
diff --git a/testsuite/tests/typecheck/should_fail/tcfail150.stderr b/testsuite/tests/typecheck/should_fail/tcfail150.stderr
index 9d63f6318e..fe14a3ab1c 100644
--- a/testsuite/tests/typecheck/should_fail/tcfail150.stderr
+++ b/testsuite/tests/typecheck/should_fail/tcfail150.stderr
@@ -2,7 +2,7 @@
tcfail150.hs:6:3: error:
• Constraint ‘Eq a’ in the type of ‘op’
constrains only the class type variables
- Use ConstrainedClassMethods to allow it
+ Enable ConstrainedClassMethods to allow it
• When checking the class method:
op :: forall a. (Foo a, Eq a) => a -> a
In the class declaration for ‘Foo’