Commit 6ec9e958 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Fix wrong-kind-of-family error message (Trac #9896)

parent 726ea08a
......@@ -2223,8 +2223,8 @@ wrongKindOfFamily family
= ptext (sLit "Wrong category of family instance; declaration was for a")
<+> kindOfFamily
where
kindOfFamily | isTypeSynonymTyCon family = text "type synonym"
| isAlgTyCon family = text "data type"
kindOfFamily | isTypeFamilyTyCon family = text "type family"
| isDataFamilyTyCon family = text "data family"
| otherwise = pprPanic "wrongKindOfFamily" (ppr family)
wrongNumberOfParmsErr :: Arity -> SDoc
......
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’
{-# LANGUAGE TypeFamilies #-}
module T9896 where
class Test a where
type TestT a :: *
instance Test Bool where
newtype TestT Bool = Int
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’
......@@ -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, [''])
AssocTyDef03.hs:6:5:
Wrong category of family instance; declaration was for a data type
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’
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