[commit: ghc] fix-5624: Do not group coercion errors when deferring (2759f87)
José Pedro Magalhães
jpm at cs.uu.nl
Fri Dec 2 17:05:47 CET 2011
Repository : ssh://darcs.haskell.org//srv/darcs/ghc
On branch : fix-5624
http://hackage.haskell.org/trac/ghc/changeset/2759f878af0369a3c50ecd818c91f904b978f9bd
>---------------------------------------------------------------
commit 2759f878af0369a3c50ecd818c91f904b978f9bd
Author: Jose Pedro Magalhaes <jpm at cs.uu.nl>
Date: Fri Dec 2 12:00:11 2011 +0000
Do not group coercion errors when deferring
>---------------------------------------------------------------
compiler/typecheck/TcErrors.lhs | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/compiler/typecheck/TcErrors.lhs b/compiler/typecheck/TcErrors.lhs
index cf5e021..801130e 100644
--- a/compiler/typecheck/TcErrors.lhs
+++ b/compiler/typecheck/TcErrors.lhs
@@ -126,10 +126,19 @@ reportTidyWanteds ctxt (WC { wc_flat = flats, wc_insol = insols, wc_impl = impli
-- See Note [Deferring coercion errors to runtime] in TcSimplify
(True, _) -> do { mapBagM_ (reportInsoluble ctxt) given
; mapBagM_ (reportInsoluble ctxt) other
- ; groupErrs (reportEqErrs ctxt) tv_eqs
- ; groupErrs (reportFlat ctxt) others
+
+ -- Do not group errors, so that we get exactly one
+ -- error per coercion
+ ; let repWith rep (w,t) = rep ctxt [t]
+ (ctLocOrigin (evVarX w))
+ ; mapM_ (repWith reportEqErrs) tv_eqs
+ ; mapM_ (repWith reportFlat) others
+
; mapBagM_ (reportTidyImplic ctxt) implics
- ; reportAmbigErrs ctxt ambigs }
+
+ ; let repAmbigs x = reportAmbigGroup ctxt
+ [(x, varSetElems (tyVarsOfEvVarX x))]
+ ; mapM_ repAmbigs ambigs }
-- There are insolubles, so report only those
-- because they are unconditionally wrong
More information about the Cvs-ghc
mailing list