From 128d455f9111c3360a41303a9c7df0206da9bc07 Mon Sep 17 00:00:00 2001 From: sof <unknown> Date: Sat, 5 Jul 1997 02:28:15 +0000 Subject: [PATCH] [project @ 1997-07-05 02:28:15 by sof] err msgs improved --- ghc/compiler/typecheck/TcSimplify.lhs | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/ghc/compiler/typecheck/TcSimplify.lhs b/ghc/compiler/typecheck/TcSimplify.lhs index 0c52f1db5a1b..27e54e6ea743 100644 --- a/ghc/compiler/typecheck/TcSimplify.lhs +++ b/ghc/compiler/typecheck/TcSimplify.lhs @@ -27,7 +27,7 @@ import Inst ( lookupInst, lookupSimpleInst, matchesInst, instToId, instBindingRequired, instCanBeGeneralised, newDictsAtLoc, pprInst, - Inst(..), SYN_IE(LIE), zonkLIE, emptyLIE, + Inst(..), SYN_IE(LIE), zonkLIE, emptyLIE, pprLIE, pprLIEInFull, plusLIE, unitLIE, consLIE, InstOrigin(..), OverloadedLit ) import TcEnv ( tcGetGlobalTyVars ) @@ -717,18 +717,23 @@ genCantGenErr insts sty -- Can't generalise these Insts \end{code} \begin{code} -ambigErr insts sty - = hang (ptext SLIT("Ambiguous overloading")) - 4 (vcat (map (pprInst sty) insts)) +ambigErr dicts sty + = sep [text "Ambiguous context" <+> pprLIE sty lie, + nest 4 (pprLIEInFull sty lie) + ] + where + lie = listToBag dicts -- Yuk \end{code} @reduceErr@ complains if we can't express required dictionaries in terms of the signature. \begin{code} -reduceErr insts sty - = hang (text "Context required by inferred type, but missing on a type signature") - 4 (vcat (map (pprInst sty) (bagToList insts))) +reduceErr lie sty + = sep [text "Context" <+> pprLIE sty lie, + nest 4 (text "required by inferred type, but missing on a type signature"), + nest 4 (pprLIEInFull sty lie) + ] \end{code} -- GitLab