Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
4,322
Issues
4,322
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
362
Merge Requests
362
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
bf83435b
Commit
bf83435b
authored
Oct 24, 2017
by
Ben Gamari
🐢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
typecheck: Clarify errors mentioned in
#14385
parent
61f1b46e
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
30 additions
and
30 deletions
+30
-30
compiler/typecheck/TcTyClsDecls.hs
compiler/typecheck/TcTyClsDecls.hs
+6
-6
testsuite/tests/gadt/gadtSyntaxFail001.stderr
testsuite/tests/gadt/gadtSyntaxFail001.stderr
+1
-1
testsuite/tests/gadt/gadtSyntaxFail002.stderr
testsuite/tests/gadt/gadtSyntaxFail002.stderr
+1
-1
testsuite/tests/gadt/gadtSyntaxFail003.stderr
testsuite/tests/gadt/gadtSyntaxFail003.stderr
+1
-1
testsuite/tests/ghci/scripts/T9293.stderr
testsuite/tests/ghci/scripts/T9293.stderr
+3
-3
testsuite/tests/ghci/scripts/ghci057.stderr
testsuite/tests/ghci/scripts/ghci057.stderr
+3
-3
testsuite/tests/module/mod39.stderr
testsuite/tests/module/mod39.stderr
+1
-1
testsuite/tests/parser/should_fail/readFail037.stderr
testsuite/tests/parser/should_fail/readFail037.stderr
+4
-4
testsuite/tests/parser/should_fail/readFail041.stderr
testsuite/tests/parser/should_fail/readFail041.stderr
+4
-4
testsuite/tests/typecheck/should_fail/T12083a.stderr
testsuite/tests/typecheck/should_fail/T12083a.stderr
+1
-1
testsuite/tests/typecheck/should_fail/TcNoNullaryTC.stderr
testsuite/tests/typecheck/should_fail/TcNoNullaryTC.stderr
+4
-4
testsuite/tests/typecheck/should_fail/tcfail150.stderr
testsuite/tests/typecheck/should_fail/tcfail150.stderr
+1
-1
No files found.
compiler/typecheck/TcTyClsDecls.hs
View file @
bf83435b
...
...
@@ -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
"
Us
e TypeFamilies to allow indexed type families"
)
2
(
text
"
Enabl
e 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
(
"
Us
e MultiParamTypeClasses to allow "
parens
(
text
(
"
Enabl
e MultiParamTypeClasses to allow "
++
allowWhat
++
" classes"
))]
classFunDepsErr
::
Class
->
SDoc
classFunDepsErr
cls
=
vcat
[
text
"Fundeps in class"
<+>
quotes
(
ppr
cls
),
parens
(
text
"
Us
e FunctionalDependencies to allow fundeps"
)]
parens
(
text
"
Enabl
e 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
"
Us
e ConstrainedClassMethods to allow it"
]
,
text
"
Enabl
e 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 GADT
s"
)
]
,
nest
2
(
parens
$
text
"
Enable the GADTs extension to allow thi
s"
)
]
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
"
Us
e ExistentialQuantification or GADTs to allow this"
])
,
parens
$
text
"
Enabl
e ExistentialQuantification or GADTs to allow this"
])
badGADT
::
DataCon
->
[
EqSpec
]
->
SDoc
badGADT
con
eq_specs
...
...
testsuite/tests/gadt/gadtSyntaxFail001.stderr
View file @
bf83435b
...
...
@@ -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
(
Us
e ExistentialQuantification or GADTs to allow this)
(
Enabl
e ExistentialQuantification or GADTs to allow this)
• In the definition of data constructor ‘C2’
In the data type declaration for ‘Foo’
testsuite/tests/gadt/gadtSyntaxFail002.stderr
View file @
bf83435b
...
...
@@ -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
(
Us
e ExistentialQuantification or GADTs to allow this)
(
Enabl
e ExistentialQuantification or GADTs to allow this)
• In the definition of data constructor ‘C2’
In the data type declaration for ‘Foo’
testsuite/tests/gadt/gadtSyntaxFail003.stderr
View file @
bf83435b
...
...
@@ -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
(
Us
e ExistentialQuantification or GADTs to allow this)
(
Enabl
e ExistentialQuantification or GADTs to allow this)
• In the definition of data constructor ‘C1’
In the data type declaration for ‘Foo’
testsuite/tests/ghci/scripts/T9293.stderr
View file @
bf83435b
<interactive>:4:1: error:
• Illegal generalised algebraic data declaration for ‘T’
(
Use GADTs to allow GADT
s)
(
Enable the GADTs extension to allow thi
s)
• 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
(
Us
e ExistentialQuantification or GADTs to allow this)
(
Enabl
e 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
(
Us
e ExistentialQuantification or GADTs to allow this)
(
Enabl
e ExistentialQuantification or GADTs to allow this)
• In the definition of data constructor ‘C’
In the data type declaration for ‘T’
testsuite/tests/ghci/scripts/ghci057.stderr
View file @
bf83435b
<interactive>:4:1: error:
• Illegal generalised algebraic data declaration for ‘T’
(
Use GADTs to allow GADT
s)
(
Enable the GADTs extension to allow thi
s)
• 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
(
Us
e ExistentialQuantification or GADTs to allow this)
(
Enabl
e 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
(
Us
e ExistentialQuantification or GADTs to allow this)
(
Enabl
e ExistentialQuantification or GADTs to allow this)
• In the definition of data constructor ‘C’
In the data type declaration for ‘T’
testsuite/tests/module/mod39.stderr
View file @
bf83435b
...
...
@@ -2,6 +2,6 @@
mod39.hs:3:17: error:
• Constraint ‘Eq a’ in the type of ‘f’
constrains only the class type variables
Us
e ConstrainedClassMethods to allow it
Enabl
e ConstrainedClassMethods to allow it
• When checking the class method: f :: forall a. (C a, Eq a) => a
In the class declaration for ‘C’
testsuite/tests/parser/should_fail/readFail037.stderr
View file @
bf83435b
readFail037.hs:4:1:
Too many parameters for class ‘Foo’
(Us
e MultiParamTypeClasses to allow multi-parameter classes)
In the class declaration for ‘Foo’
readFail037.hs:4:1:
error:
•
Too many parameters for class ‘Foo’
(Enabl
e MultiParamTypeClasses to allow multi-parameter classes)
•
In the class declaration for ‘Foo’
testsuite/tests/parser/should_fail/readFail041.stderr
View file @
bf83435b
readFail041.hs:6:1:
Fundeps in class ‘Foo’
(Us
e FunctionalDependencies to allow fundeps)
In the class declaration for ‘Foo’
readFail041.hs:6:1:
error:
•
Fundeps in class ‘Foo’
(Enabl
e FunctionalDependencies to allow fundeps)
•
In the class declaration for ‘Foo’
testsuite/tests/typecheck/should_fail/T12083a.stderr
View file @
bf83435b
...
...
@@ -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
(
Us
e ExistentialQuantification or GADTs to allow this)
(
Enabl
e ExistentialQuantification or GADTs to allow this)
• In the definition of data constructor ‘ExistentiallyLost’
In the data type declaration for ‘ExistentiallyLost’
testsuite/tests/typecheck/should_fail/TcNoNullaryTC.stderr
View file @
bf83435b
TcNoNullaryTC.hs:3:1:
No parameters for class ‘A’
(Us
e MultiParamTypeClasses to allow no-parameter classes)
In the class declaration for ‘A’
TcNoNullaryTC.hs:3:1:
error:
•
No parameters for class ‘A’
(Enabl
e MultiParamTypeClasses to allow no-parameter classes)
•
In the class declaration for ‘A’
testsuite/tests/typecheck/should_fail/tcfail150.stderr
View file @
bf83435b
...
...
@@ -2,7 +2,7 @@
tcfail150.hs:6:3: error:
• Constraint ‘Eq a’ in the type of ‘op’
constrains only the class type variables
Us
e ConstrainedClassMethods to allow it
Enabl
e ConstrainedClassMethods to allow it
• When checking the class method:
op :: forall a. (Foo a, Eq a) => a -> a
In the class declaration for ‘Foo’
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment