X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcInstDcls.lhs;h=e186b365fa73f57eda73c559db1e9078bcb66b02;hb=d76c18e05f6366c23144624b696a02fbaa6d26e8;hp=3449766a0650f34e19548f1c88bb81363a33b1db;hpb=53569e145c8ff8af89303742f261302fdcd98f04;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcInstDcls.lhs b/compiler/typecheck/TcInstDcls.lhs index 3449766..e186b36 100644 --- a/compiler/typecheck/TcInstDcls.lhs +++ b/compiler/typecheck/TcInstDcls.lhs @@ -33,7 +33,7 @@ import Type ( zipOpenTvSubst, substTheta, mkTyConApp, mkTyVarTy, splitFunTys, TyThing(ATyCon), isTyVarTy, tcEqType, substTys, emptyTvSubst, extendTvSubst ) import Coercion ( mkSymCoercion ) -import TyCon ( TyCon, tyConName, newTyConCo, tyConTyVars, +import TyCon ( TyCon, tyConName, newTyConCo_maybe, tyConTyVars, isTyConAssoc, tyConFamInst_maybe, assocTyConArgPoss_maybe ) import DataCon ( classDataCon, dataConTyCon, dataConInstArgTys ) @@ -550,7 +550,7 @@ tcInstDecl2 (InstInfo { iSpec = ispec, where -- For newtype T a = MkT -- The returned coercion has kind :: C (T a):=:C - co_fn tvs cls_tycon cls_inst_tys | Just co_con <- newTyConCo tycon + co_fn tvs cls_tycon cls_inst_tys | Just co_con <- newTyConCo_maybe tycon = ExprCoFn (mkTyConApp cls_tycon (drop_tail 1 cls_inst_tys ++ [mkSymCoercion (mkTyConApp co_con (map mkTyVarTy tvs))])) | otherwise @@ -833,8 +833,9 @@ atInstCtxt name = ptext SLIT("In the associated type instance for") <+> quotes (ppr name) mustBeVarArgErr ty = - sep [ ptext SLIT("Arguments that do not correspond to a class parameter") - , ptext SLIT("must be variables:") <+> ppr ty + sep [ ptext SLIT("Arguments that do not correspond to a class parameter") <+> + ptext SLIT("must be variables") + , ptext SLIT("Instead of a variable, found") <+> ppr ty ] wrongATArgErr ty instTy =