summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorManuel M T Chakravarty <chak@cse.unsw.edu.au>2008-07-14 09:45:24 +0000
committerManuel M T Chakravarty <chak@cse.unsw.edu.au>2008-07-14 09:45:24 +0000
commitaf97da871e57bfd256f21e3c8bff5ef34b83f7ce (patch)
tree149e12428b51d33efc45c9b677d4b9cba19290cc /compiler
parent80fe09d777ec2d4cc8dc3d58bf57d0a0684e0bf6 (diff)
downloadhaskell-af97da871e57bfd256f21e3c8bff5ef34b83f7ce.tar.gz
Fix check of rhs of type family instances (#2157)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/typecheck/TcMType.lhs8
-rw-r--r--compiler/typecheck/TcTyClsDecls.lhs3
2 files changed, 2 insertions, 9 deletions
diff --git a/compiler/typecheck/TcMType.lhs b/compiler/typecheck/TcMType.lhs
index ecdf59f9af..fc620ec3de 100644
--- a/compiler/typecheck/TcMType.lhs
+++ b/compiler/typecheck/TcMType.lhs
@@ -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,
diff --git a/compiler/typecheck/TcTyClsDecls.lhs b/compiler/typecheck/TcTyClsDecls.lhs
index 635fef9da8..4a2a289e50 100644
--- a/compiler/typecheck/TcTyClsDecls.lhs
+++ b/compiler/typecheck/TcTyClsDecls.lhs
@@ -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