Simon Peyton Jones pushed to branch wip/T26255 at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Tc/Errors.hs
    ... ... @@ -558,10 +558,11 @@ reportWanteds ctxt tc_lvl wc@(WC { wc_simple = simples, wc_impl = implics
    558 558
                 -- wanted insoluble here; but do suppress inner insolubles
    
    559 559
                 -- if there's a *given* insoluble here (= inaccessible code)
    
    560 560
     
    
    561
    -         -- Only now, if there are no errors, do we report suppressed ones
    
    562
    -         -- See Note [Suppressing confusing errors]. We don't need to update
    
    563
    -         -- the context further because of the whenNoErrs guard
    
    564
    -       ; whenNoErrs $
    
    561
    +         -- If there are no other errors to report, report suppressed errors.
    
    562
    +         -- See Note [Suppressing confusing errors].  NB: with -fdefer-type-errors
    
    563
    +         -- we might have reported warnings only from `items0`, but we still want to
    
    564
    +         -- suppress the `suppressed_items`.
    
    565
    +       ; when (null items0) $
    
    565 566
              do { (_, more_leftovers) <- tryReporters ctxt_for_insols (report1++report2)
    
    566 567
                                                       suppressed_items
    
    567 568
                      -- ctxt_for_insols: the suppressed errors can be Int~Bool, which