summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorsimonpj@microsoft.com <unknown>2010-10-08 11:13:18 +0000
committersimonpj@microsoft.com <unknown>2010-10-08 11:13:18 +0000
commit7e3ec3f3aa3ecaf39cb4519f562ee20debcb5ece (patch)
treee4196838c853202ca68d1c36416ee8c1c7be6688 /compiler
parentd39629e988c3eb2ef1def1e423a18dd1289a7a52 (diff)
downloadhaskell-7e3ec3f3aa3ecaf39cb4519f562ee20debcb5ece.tar.gz
Suppress ambiguity errors if any other errors occur
Diffstat (limited to 'compiler')
-rw-r--r--compiler/typecheck/TcErrors.lhs7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/typecheck/TcErrors.lhs b/compiler/typecheck/TcErrors.lhs
index 0ade93c29f..1254dd6aae 100644
--- a/compiler/typecheck/TcErrors.lhs
+++ b/compiler/typecheck/TcErrors.lhs
@@ -125,10 +125,9 @@ reportTidyWanteds ctxt unsolved
; when (null tv_eqs) $ groupErrs (reportFlat ctxt) others
; when (null tv_eqs) $ mapBagM_ (reportTidyImplic ctxt) implics
- -- Only report ambiguity if no other errors happened
- -- See Note [Avoiding spurious errors]
- ; when (isEmptyBag implics && null non_ambigs) $
- reportAmbigErrs ctxt skols ambigs }
+ -- Only report ambiguity if no other errors (at all) happened
+ -- See Note [Avoiding spurious errors] in TcSimplify
+ ; ifErrsM (return ()) $ reportAmbigErrs ctxt skols ambigs }
where
skols = foldr (unionVarSet . ic_skols) emptyVarSet (cec_encl ctxt)