+ returnRn (ClassDecl context' cname' tyvars' fds' (non_ops' ++ sigs') EmptyMonoBinds names' src_loc)
+ where
+ cls_doc = text "the declaration for class" <+> ppr cname
+ sig_doc = text "the signatures for class" <+> ppr cname
+
+rnClassOp clas clas_tyvars clas_fds sig@(ClassOpSig op maybe_dm_stuff ty locn)
+ = pushSrcLocRn locn $
+ lookupTopBndrRn op `thenRn` \ op_name ->
+
+ -- Check the signature
+ rnHsSigType (quotes (ppr op)) ty `thenRn` \ new_ty ->
+
+ -- Make the default-method name
+ (case maybe_dm_stuff of
+ Nothing -> returnRn Nothing -- Source-file class decl
+
+ Just (DefMeth dm_rdr_name)
+ -> -- Imported class that has a default method decl
+ -- See comments with tname, snames, above
+ lookupSysBinder dm_rdr_name `thenRn` \ dm_name ->
+ returnRn (Just (DefMeth dm_name))
+ -- An imported class decl for a class decl that had an explicit default
+ -- method, mentions, rather than defines,
+ -- the default method, so we must arrange to pull it in
+
+ Just GenDefMeth -> returnRn (Just GenDefMeth)
+ Just NoDefMeth -> returnRn (Just NoDefMeth)
+ ) `thenRn` \ maybe_dm_stuff' ->
+
+ returnRn (ClassOpSig op_name maybe_dm_stuff' new_ty locn)
+
+rnClassBinds :: RdrNameTyClDecl -> RenamedTyClDecl -> RnMS (RenamedTyClDecl, FreeVars)
+ -- Rename the mbinds only; the rest is done already
+rnClassBinds (ClassDecl _ _ _ _ _ mbinds _ _ ) -- Get mbinds from here
+ (ClassDecl context cname tyvars fds sigs _ names src_loc) -- Everything else is here
+ = -- The newLocals call is tiresome: given a generic class decl