X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcClassDcl.lhs;h=9d0fb13c54b82e05318fb1a0e76d991dc17a58ce;hb=171d4582f4b9a8e0f11f8738079accbb22bafdcb;hp=9fb530de5959f5fa6279759f1d9ea94b058fa826;hpb=202ac08f3e2afde0620e889cc81a95b2fd0ad9e1;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcClassDcl.lhs b/compiler/typecheck/TcClassDcl.lhs index 9fb530d..9d0fb13 100644 --- a/compiler/typecheck/TcClassDcl.lhs +++ b/compiler/typecheck/TcClassDcl.lhs @@ -7,7 +7,7 @@ module TcClassDcl ( tcClassSigs, tcClassDecl2, getGenericInstances, MethodSpec, tcMethodBind, mkMethodBind, - tcAddDeclCtxt, badMethodErr + tcAddDeclCtxt, badMethodErr, badATErr, omittedATWarn ) where #include "HsVersions.h" @@ -632,6 +632,8 @@ get_generics decl@(ClassDecl {tcdLName = class_name, tcdMeths = def_methods}) -- f {| a+b |} ... = ... -- f {| x+y |} ... = ... -- Then at this point we'll have an InstInfo for each + -- + -- The class should be unary, which is why simpleInstInfoTyCon should be ok let tc_inst_infos :: [(TyCon, InstInfo)] tc_inst_infos = [(simpleInstInfoTyCon i, i) | i <- inst_infos] @@ -759,9 +761,16 @@ badMethodErr clas op = hsep [ptext SLIT("Class"), quotes (ppr clas), ptext SLIT("does not have a method"), quotes (ppr op)] +badATErr clas at + = hsep [ptext SLIT("Class"), quotes (ppr clas), + ptext SLIT("does not have an associated type"), quotes (ppr at)] + omittedMethodWarn sel_id = ptext SLIT("No explicit method nor default method for") <+> quotes (ppr sel_id) +omittedATWarn at + = ptext SLIT("No explicit AT declaration for") <+> quotes (ppr at) + badGenericInstance sel_id because = sep [ptext SLIT("Can't derive generic code for") <+> quotes (ppr sel_id), because]