Repository : ssh://darcs.haskell.org//srv/darcs/ghc On branch : master
http://hackage.haskell.org/trac/ghc/changeset/d9ea938bb7da4cf39b33e4e9d44f6bbd0460c388 >--------------------------------------------------------------- commit d9ea938bb7da4cf39b33e4e9d44f6bbd0460c388 Author: Simon Peyton Jones <[email protected]> Date: Tue Jul 10 15:49:02 2012 +0100 Suppress ambiguity errors if there are other solid errors to report >--------------------------------------------------------------- compiler/typecheck/TcErrors.lhs | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/compiler/typecheck/TcErrors.lhs b/compiler/typecheck/TcErrors.lhs index ff774fa..dd20277 100644 --- a/compiler/typecheck/TcErrors.lhs +++ b/compiler/typecheck/TcErrors.lhs @@ -79,7 +79,10 @@ reportUnsolved runtimeCoercionErrors wanted ; let tidy_env = tidyFreeTyVars env0 free_tvs free_tvs = tyVarsOfWC wanted err_ctxt = CEC { cec_encl = [] - , cec_insol = errs_so_far + , cec_insol = errs_so_far || insolubleWC wanted + -- Don't report ambiguity errors if + -- there are any other solid errors + -- to report , cec_extra = empty , cec_tidy = tidy_env , cec_defer = defer } @@ -236,6 +239,7 @@ mkReporter mk_err = mapM_ (\ct -> do { err <- setCtFlavorLoc (cc_ev ct) $ ; reportError err }) tryReporters :: [(String, Ct -> PredTree -> Bool, Reporter)] -> Reporter -> Reporter +-- Use the first reporter in the list whose predicate says True tryReporters reporters deflt cts = do { traceTc "tryReporters {" (ppr cts) ; go reporters cts _______________________________________________ Cvs-ghc mailing list [email protected] http://www.haskell.org/mailman/listinfo/cvs-ghc
