From: sof Date: Sat, 5 Jul 1997 02:28:15 +0000 (+0000) Subject: [project @ 1997-07-05 02:28:15 by sof] X-Git-Tag: Approximately_1000_patches_recorded~267 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=128d455f9111c3360a41303a9c7df0206da9bc07;p=ghc-hetmet.git [project @ 1997-07-05 02:28:15 by sof] err msgs improved --- diff --git a/ghc/compiler/typecheck/TcSimplify.lhs b/ghc/compiler/typecheck/TcSimplify.lhs index 0c52f1d..27e54e6 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}