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 <[email protected]>
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



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to