Fix check of rhs of type family instances (#2157)
[ghc-hetmet.git] / compiler / typecheck / TcMType.lhs
index ecdf59f..fc620ec 100644 (file)
@@ -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,