[project @ 1999-05-26 16:54:22 by simonpj]
authorsimonpj <unknown>
Wed, 26 May 1999 16:54:26 +0000 (16:54 +0000)
committersimonpj <unknown>
Wed, 26 May 1999 16:54:26 +0000 (16:54 +0000)
Minor improvements in error messages

ghc/compiler/rename/RnSource.lhs
ghc/compiler/typecheck/TcExpr.lhs
ghc/compiler/types/PprType.lhs

index 9044b87..68b817f 100644 (file)
@@ -886,8 +886,7 @@ forAllErr doc ty tyvar
       (ptext SLIT("In") <+> doc))
 
 ctxtErr explicit_forall doc tyvars constraint ty
-  = sep [ptext SLIT("None of the type variable(s) in the constraint") <+> quotes (pprClassAssertion constraint) <+>
-                  ptext SLIT("does not mention any of"),
+  = sep [ptext SLIT("None of the type variable(s) in the constraint") <+> quotes (pprClassAssertion constraint),
         if explicit_forall then
           nest 4 (ptext SLIT("is universally quantified (i.e. bound by the forall)"))
         else
index e2599cf..a27b3b0 100644 (file)
@@ -159,7 +159,8 @@ tcPolyExpr arg expected_arg_ty
     returnTc ( generalised_arg, free_insts,
               arg', sig_tau, lie_arg )
   where
-    sig_msg ty = ptext SLIT("In an expression with expected type:") <+> ppr ty
+    sig_msg ty = sep [ptext SLIT("In an expression with expected type:"),
+                     nest 4 (ppr ty)]
 \end{code}
 
 %************************************************************************
index 8c29300..6b1b905 100644 (file)
@@ -170,7 +170,7 @@ ppr_ty env ctxt_prec ty@(ForAllTy _ _)
        -- The type checker occasionally prints a type in an error message,
        -- and it had better come out looking like a user type
        sep [ ptext SLIT("forall") <+> pp_tyvars <> ptext SLIT("."), 
-            ppr_theta theta <+> ptext SLIT("=>"),
+            ppr_theta theta,
             ppr_ty env tOP_PREC tau
           ]
   where                
@@ -179,7 +179,10 @@ ppr_ty env ctxt_prec ty@(ForAllTy _ _)
     
     pp_tyvars = hsep (map (pBndr env LambdaBind) tyvars)
     
-    ppr_theta theta     = parens (hsep (punctuate comma (map ppr_dict theta)))
+    ppr_theta []       = empty
+    ppr_theta theta     = parens (hsep (punctuate comma (map ppr_dict theta))) 
+                         <+> ptext SLIT("=>")
+
     ppr_dict (clas,tys) = ppr clas <+> hsep (map (ppr_ty env tYCON_PREC) tys)