Commit 7e3ec3f3 authored by simonpj@microsoft.com's avatar simonpj@microsoft.com

Suppress ambiguity errors if any other errors occur

parent d39629e9
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment