X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Ftypecheck%2FTcClassDcl.lhs;h=e9e5843590639c52727247bf6aeb7cd7e58cff28;hb=00cc4d8773d1138f7b3b3ac122f3c98a6f93e68a;hp=25795cef9a6fe3243600f964da8d92a1ee37dea3;hpb=15cb792d18b1094e98c035dca6ecec5dad516056;p=ghc-hetmet.git diff --git a/compiler/typecheck/TcClassDcl.lhs b/compiler/typecheck/TcClassDcl.lhs index 25795ce..e9e5843 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" @@ -739,8 +739,12 @@ tcAddDeclCtxt decl thing_inside thing = case decl of ClassDecl {} -> "class" TySynonym {} -> "type synonym" - TyData {tcdND = NewType} -> "newtype" - TyData {tcdND = DataType} -> "data type" + TyFunction {} -> "type function signature" + TyData {tcdND = NewType} -> "newtype" ++ maybeSig + TyData {tcdND = DataType} -> "data type" ++ maybeSig + + maybeSig | isKindSigDecl decl = " signature" + | otherwise = "" ctxt = hsep [ptext SLIT("In the"), text thing, ptext SLIT("declaration for"), quotes (ppr (tcdName decl))] @@ -755,9 +759,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]