X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftypecheck%2FTcClassDcl.lhs;h=fbb450a19913ee51773d7aa29feabadd57dc1022;hb=9d7da331989abcd1844e9d03b8d1e4163796fa85;hp=b5629683b4abc213b3f2bcc5f3134c3d0d9b375d;hpb=e3a4d6c36802d9395b40af1d9fb24cbd7ce2f720;p=ghc-hetmet.git diff --git a/ghc/compiler/typecheck/TcClassDcl.lhs b/ghc/compiler/typecheck/TcClassDcl.lhs index b562968..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(..) ) @@ -118,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) @@ -151,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 @@ -487,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