From af97da871e57bfd256f21e3c8bff5ef34b83f7ce Mon Sep 17 00:00:00 2001 From: Manuel M T Chakravarty Date: Mon, 14 Jul 2008 09:45:24 +0000 Subject: [PATCH] Fix check of rhs of type family instances (#2157) --- compiler/typecheck/TcMType.lhs | 8 +------- compiler/typecheck/TcTyClsDecls.lhs | 3 +-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/compiler/typecheck/TcMType.lhs b/compiler/typecheck/TcMType.lhs index ecdf59f..fc620ec 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 635fef9..4a2a289 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 -- 1.7.10.4