Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tobias Decking
GHC
Commits
6ec9e958
Commit
6ec9e958
authored
Dec 18, 2014
by
Simon Peyton Jones
Browse files
Fix wrong-kind-of-family error message (Trac #9896)
parent
726ea08a
Changes
6
Hide whitespace changes
Inline
Side-by-side
compiler/typecheck/TcTyClsDecls.hs
View file @
6ec9e958
...
...
@@ -2223,8 +2223,8 @@ wrongKindOfFamily family
=
ptext
(
sLit
"Wrong category of family instance; declaration was for a"
)
<+>
kindOfFamily
where
kindOfFamily
|
isType
Synonym
TyCon
family
=
text
"type
synonym
"
|
is
AlgTyCon
family
=
text
"data
type
"
kindOfFamily
|
isType
Family
TyCon
family
=
text
"type
family
"
|
is
DataFamilyTyCon
family
=
text
"data
family
"
|
otherwise
=
pprPanic
"wrongKindOfFamily"
(
ppr
family
)
wrongNumberOfParmsErr
::
Arity
->
SDoc
...
...
testsuite/tests/indexed-types/should_fail/SimpleFail3a.stderr
View file @
6ec9e958
SimpleFail3a.hs:10:3:
Wrong category of family instance; declaration was for a data
type
Wrong category of family instance; declaration was for a data
family
In the type instance declaration for ‘S1’
In the instance declaration for ‘C1 Int’
testsuite/tests/indexed-types/should_fail/T9896.hs
0 → 100644
View file @
6ec9e958
{-# LANGUAGE TypeFamilies #-}
module
T9896
where
class
Test
a
where
type
TestT
a
::
*
instance
Test
Bool
where
newtype
TestT
Bool
=
Int
testsuite/tests/indexed-types/should_fail/T9896.stderr
0 → 100644
View file @
6ec9e958
T9896.hs:8:3:
Wrong category of family instance; declaration was for a type family
In the newtype instance declaration for ‘TestT’
In the instance declaration for ‘Test Bool’
testsuite/tests/indexed-types/should_fail/all.T
View file @
6ec9e958
...
...
@@ -131,3 +131,4 @@ test('BadSock', normal, compile_fail, [''])
test
('
T9580
',
normal
,
multimod_compile_fail
,
['
T9580
',
''])
test
('
T9662
',
normal
,
compile_fail
,
[''])
test
('
T7862
',
normal
,
compile_fail
,
[''])
test
('
T9896
',
normal
,
compile_fail
,
[''])
testsuite/tests/typecheck/should_fail/AssocTyDef03.stderr
View file @
6ec9e958
AssocTyDef03.hs:6:5:
Wrong category of family instance; declaration was for a data
type
In the default type instance declaration for ‘Typ’
In the class declaration for ‘Cls’
AssocTyDef03.hs:6:5:
Wrong category of family instance; declaration was for a data
family
In the default type instance declaration for ‘Typ’
In the class declaration for ‘Cls’
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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