From e07e74e5a074490d25443aeff4db4f1f299040c4 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Wed, 14 Mar 2007 16:29:06 +0000 Subject: [PATCH] Improve error messages slightly, saying "a1...an" instead of "a b c" --- compiler/typecheck/TcClassDcl.lhs | 2 +- compiler/typecheck/TcMType.lhs | 4 ++-- compiler/typecheck/TcTyClsDecls.lhs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/typecheck/TcClassDcl.lhs b/compiler/typecheck/TcClassDcl.lhs index f43a4d7..87c1841 100644 --- a/compiler/typecheck/TcClassDcl.lhs +++ b/compiler/typecheck/TcClassDcl.lhs @@ -767,7 +767,7 @@ badGenericInstance sel_id because notSimple inst_tys = vcat [ptext SLIT("because the instance type(s)"), nest 2 (ppr inst_tys), - ptext SLIT("is not a simple type of form (T a b c)")] + ptext SLIT("is not a simple type of form (T a1 ... an)")] notGeneric tycon = vcat [ptext SLIT("because the instance type constructor") <+> quotes (ppr tycon) <+> diff --git a/compiler/typecheck/TcMType.lhs b/compiler/typecheck/TcMType.lhs index ca5ca0e..12f3a73 100644 --- a/compiler/typecheck/TcMType.lhs +++ b/compiler/typecheck/TcMType.lhs @@ -1136,8 +1136,8 @@ check_inst_head dflags clas tys where (first_ty : _) = tys - head_shape_msg = parens (text "The instance type must be of form (T a b c)" $$ - text "where T is not a synonym, and a,b,c are distinct type variables") + head_shape_msg = parens (text "The instance type must be of form (T a1 ... an)" $$ + text "where T is not a synonym, and a1 ... an are distinct type variables") -- For now, I only allow tau-types (not polytypes) in -- the head of an instance decl. diff --git a/compiler/typecheck/TcTyClsDecls.lhs b/compiler/typecheck/TcTyClsDecls.lhs index 74e3fb3..4313ad9 100644 --- a/compiler/typecheck/TcTyClsDecls.lhs +++ b/compiler/typecheck/TcTyClsDecls.lhs @@ -1146,7 +1146,7 @@ newtypeExError con nest 2 $ ptext SLIT("but") <+> quotes (ppr con) <+> ptext SLIT("does")] newtypePredError con - = sep [ptext SLIT("A newtype constructor must have a return type of form T a b c"), + = sep [ptext SLIT("A newtype constructor must have a return type of form T a1 ... an"), nest 2 $ ptext SLIT("but") <+> quotes (ppr con) <+> ptext SLIT("does not")] newtypeFieldErr con_name n_flds -- 1.7.10.4