X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcClassDcl.lhs;h=fbb450a19913ee51773d7aa29feabadd57dc1022;hb=9d7da331989abcd1844e9d03b8d1e4163796fa85;hp=22dc9b2bac55293c8a6ac810becc66d1777cc447;hpb=a7ecdf96844404b7bc8273d4ff6d85759278427c;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcClassDcl.lhs b/ghc/compiler/typecheck/TcClassDcl.lhs index 22dc9b2..fbb450a 100644 --- a/ghc/compiler/typecheck/TcClassDcl.lhs +++ b/ghc/compiler/typecheck/TcClassDcl.lhs @@ -52,7 +52,6 @@ import RdrName ( RdrName, mkDerivedRdrName ) import Outputable import PrelNames ( genericTyConNames ) import DynFlags -import UnicodeUtil ( stringToUtf8 ) import ErrUtils ( dumpIfSet_dyn ) import Util ( count, lengthIs, isSingleton, lengthExceeds ) import Unique ( Uniquable(..) ) @@ -60,6 +59,7 @@ import ListSetOps ( equivClassesByUniq, minusList ) import SrcLoc ( Located(..), srcSpanStart, unLoc, noLoc ) import Maybes ( seqMaybe, isJust, mapCatMaybes ) import List ( partition ) +import BasicTypes ( RecFlag(..) ) import Bag import FastString \end{code} @@ -117,8 +117,8 @@ tcClassSigs clas sigs def_methods = do { dm_env <- checkDefaultBinds clas op_names def_methods ; mappM (tcClassSig dm_env) op_sigs } where - op_sigs = [sig | sig@(L _ (Sig _ _)) <- sigs] - op_names = [n | sig@(L _ (Sig (L _ n) _)) <- op_sigs] + op_sigs = [sig | sig@(L _ (TypeSig _ _)) <- sigs] + op_names = [n | sig@(L _ (TypeSig (L _ n) _)) <- op_sigs] checkDefaultBinds :: Name -> [Name] -> LHsBinds Name -> TcM (NameEnv Bool) @@ -150,7 +150,7 @@ tcClassSig :: NameEnv Bool -- Info about default methods; -> LSig Name -> TcM TcMethInfo -tcClassSig dm_env (L loc (Sig (L _ op_name) op_hs_ty)) +tcClassSig dm_env (L loc (TypeSig (L _ op_name) op_hs_ty)) = setSrcSpan loc $ do { op_ty <- tcHsKindedType op_hs_ty -- Class tyvars already in scope ; let dm = case lookupNameEnv dm_env op_name of @@ -356,7 +356,7 @@ tcMethodBind inst_tyvars inst_theta avail_insts prag_fn tcExtendTyVarEnv inst_tyvars ( addErrCtxt (methodCtxt sel_id) $ getLIE $ - tcMonoBinds [meth_bind] lookup_sig True + tcMonoBinds [meth_bind] lookup_sig Recursive ) `thenM` \ ((meth_bind, mono_bind_infos), meth_lie) -> -- Now do context reduction. We simplify wrt both the local tyvars @@ -486,7 +486,7 @@ mkDefMethRhs origin clas inst_tys sel_id loc NoDefMeth where error_rhs = noLoc $ HsLam (mkMatchGroup [mkSimpleMatch wild_pats simple_rhs]) simple_rhs = nlHsApp (nlHsVar (getName nO_METHOD_BINDING_ERROR_ID)) - (nlHsLit (HsStringPrim (mkFastString (stringToUtf8 error_msg)))) + (nlHsLit (HsStringPrim (mkFastString error_msg))) error_msg = showSDoc (hcat [ppr loc, text "|", ppr sel_id ]) -- When the type is of form t1 -> t2 -> t3