Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC

Commits:

1 changed file:

Changes:

  • compiler/GHC/Tc/Errors.hs
    ... ... @@ -557,9 +557,9 @@ reportWanteds ctxt tc_lvl wc@(WC { wc_simple = simples, wc_impl = implics
    557 557
                 -- if there's a *given* insoluble here (= inaccessible code)
    
    558 558
     
    
    559 559
              -- If there are no other errors to report, report suppressed errors.
    
    560
    -         -- See Note [Suppressing confusing errors].  NB: with -fdefer-type-errors
    
    561
    -         -- we might have reported warnings only from `reportable_items`, but we
    
    562
    -         -- still want to suppress the `suppressed_items`.
    
    560
    +         -- See (SCE3) in Note [Suppressing confusing errors].
    
    561
    +         -- NB: with -fdefer-type-errors we might have reported warnings only from
    
    562
    +         -- reportable_items`, but we still want to suppress the `suppressed_items`.
    
    563 563
            ; when (null reportable_items) $
    
    564 564
              do { (_, more_leftovers) <- tryReporters ctxt_for_insols (report1++report2)
    
    565 565
                                                       suppressed_items
    
    ... ... @@ -762,7 +762,7 @@ isTyFun_maybe ty = case tcSplitTyConApp_maybe ty of
    762 762
     Certain errors we might encounter are potentially confusing to users.
    
    763 763
     If there are any other errors to report, at all, we want to suppress these.
    
    764 764
     
    
    765
    -Which errors are suppressed?
    
    765
    +Which errors should be suppressed?
    
    766 766
     
    
    767 767
     (SCE1) Superclasses of Wanteds.  These are generated only in case they trigger functional
    
    768 768
        dependencies.  If such a constraint is unsolved, then its "parent" constraint must
    
    ... ... @@ -777,9 +777,6 @@ Which errors are suppressed?
    777 777
        We definitely want to report d1 and not d2!  Happily it's easy to filter out those
    
    778 778
        superclass-Wanteds, becuase their Origin betrays them.
    
    779 779
     
    
    780
    -   See test T18851 for an example of how it is (just, barely) possible for the /only/
    
    781
    -   errors to be superclass-of-Wanted constraints.
    
    782
    -
    
    783 780
     (SCE2) Errors which arise from the interaction of two Wanted fun-dep constraints.
    
    784 781
        Example:
    
    785 782
     
    
    ... ... @@ -810,9 +807,15 @@ Which errors are suppressed?
    810 807
     
    
    811 808
     Mechanism:
    
    812 809
     
    
    813
    -We use the `suppress` function within reportWanteds to filter out these two
    
    814
    -cases, then report all other errors. Lastly, we return to these suppressed
    
    815
    -ones and report them only if there have been no errors so far.
    
    810
    +We use the `suppress` function within reportWanteds to filter out these
    
    811
    +"suppress" cases, then report all other errors. After doing so, we return to these
    
    812
    +suppressed ones and report them only if there have been no errors so far.
    
    813
    +
    
    814
    +(SCE3) How can it happen that there are /only/ suppressed errors?  See test T18851
    
    815
    +   for an example of how it is (just, barely) possible for the /only/ errors to
    
    816
    +   be superclass-of-Wanted constraints.
    
    817
    +
    
    818
    +
    
    816 819
     
    
    817 820
     Note [Constraints to ignore]
    
    818 821
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~