Skip to content
Snippets Groups Projects
Commit af97da87 authored by chak@cse.unsw.edu.au.'s avatar chak@cse.unsw.edu.au.
Browse files

Fix check of rhs of type family instances (#2157)

parent 80fe09d7
No related branches found
No related tags found
No related merge requests found
......@@ -1681,8 +1681,7 @@ checkValidTypeInst typats rhs
; mapM_ checkTyFamFreeness typats
-- the right-hand side is a tau type
; checkTc (isTauTy rhs) $
polyTyErr rhs
; checkValidMonoType rhs
-- we have a decidable instance unless otherwise permitted
; undecidable_ok <- doptM Opt_UndecidableInstances
......@@ -1735,11 +1734,6 @@ tyFamInstInIndexErr ty
colon) 4 $
ppr ty
polyTyErr :: Type -> SDoc
polyTyErr ty
= hang (ptext (sLit "Illegal polymorphic type in type instance") <> colon) 4 $
ppr ty
famInstUndecErr :: Type -> SDoc -> SDoc
famInstUndecErr ty msg
= sep [msg,
......
......@@ -286,8 +286,7 @@ tcFamInstDecl1 (decl@TySynonym {tcdLName = L loc tc_name})
; t_typats <- mapM tcHsKindedType k_typats
; t_rhs <- tcHsKindedType k_rhs
-- (3) check that
-- - check the well-formedness of the instance
-- (3) check the well-formedness of the instance
; checkValidTypeInst t_typats t_rhs
-- (4) construct representation tycon
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment