Commit 967633d4 authored by batterseapower's avatar batterseapower

Revert "Get rid of associated-type default declarations"

This reverts commit 5e102e64.
parent 6ff6895e
......@@ -670,6 +670,12 @@ at_decl_cls :: { LTyClDecl RdrName }
-- infix type constructors to be declared
{% mkTyFamily (comb3 $1 $2 $3) TypeFamily $2 (unLoc $3) }
-- default type instance
| 'type' type '=' ctype
-- Note the use of type for the head; this allows
-- infix type constructors and type patterns
{% mkTySynonym (comb2 $1 $4) True $2 $4 }
-- data/newtype family declaration
| 'data' type opt_kind_sig
{% mkTyFamily (comb3 $1 $2 $3) DataFamily $2 (unLoc $3) }
......
......@@ -565,9 +565,10 @@ checkKindSigs :: [LTyClDecl RdrName] -> P ()
checkKindSigs = mapM_ check
where
check (L l tydecl)
| isFamilyDecl tydecl = return ()
| isFamilyDecl tydecl
|| isSynDecl tydecl = return ()
| otherwise =
parseErrorSDoc l (text "Type declaration in a class must be a kind signature:" $$ ppr tydecl)
parseErrorSDoc l (text "Type declaration in a class must be a kind signature or synonym default:" $$ ppr tydecl)
checkContext :: LHsType RdrName -> P (LHsContext RdrName)
checkContext (L l t)
......
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