- -- 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 }