| ... |
... |
@@ -262,7 +262,7 @@ report_unsolved type_errors expr_holes |
|
262
|
262
|
, cec_expr_holes = expr_holes
|
|
263
|
263
|
, cec_type_holes = type_holes
|
|
264
|
264
|
, cec_out_of_scope_holes = out_of_scope_holes
|
|
265
|
|
- , cec_suppress = False
|
|
|
265
|
+ , cec_outer_err = False
|
|
266
|
266
|
, cec_warn_redundant = warn_redundant
|
|
267
|
267
|
, cec_expand_syns = exp_syns
|
|
268
|
268
|
, cec_binds = binds_var }
|
| ... |
... |
@@ -317,26 +317,26 @@ we just switch off deferred type errors altogether. See #14605. |
|
317
|
317
|
This is done by maybeSwitchOffDefer. It's also useful in one other
|
|
318
|
318
|
place: see Note [Wrapping failing kind equalities] in GHC.Tc.Solver.
|
|
319
|
319
|
|
|
320
|
|
-Note [cec_suppress: suppressing less-important error messages]
|
|
|
320
|
+Note [cec_outer_err: suppressing less-important error messages]
|
|
321
|
321
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
322
|
|
-The cec_suppress flag says "don't report any less-important errors". Instead, just create
|
|
|
322
|
+The cec_outer_err flag says "don't report any less-important errors". Instead, just create
|
|
323
|
323
|
evidence bindings (as usual). It's used when more important errors have occurred
|
|
324
|
|
-(or will occur) eleswhere.
|
|
|
324
|
+(or will occur) elsewhere.
|
|
325
|
325
|
|
|
326
|
326
|
(SLIE0)
|
|
327
|
|
- * Note that `cec_suppress` does not affect more-important errors, namely the `report1`
|
|
|
327
|
+ * Note that `cec_outer_err` does not affect more-important errors, namely the `report1`
|
|
328
|
328
|
group in `reportWanteds`
|
|
329
|
|
- * But `cec_suppress` /does/ affect the less-important errors, namely the `report2` group.
|
|
|
329
|
+ * But `cec_outer_err` /does/ affect the less-important errors, namely the `report2` group.
|
|
330
|
330
|
To see this, look at the plumbing of cec suppress in `reportWanteds`
|
|
331
|
331
|
|
|
332
|
|
-(SLIE1) When we begin `reportAllUnsolved` we set `cec_suppress` if there are insoluble
|
|
|
332
|
+(SLIE1) When we begin `reportAllUnsolved` we set `cec_outer_err` if there are insoluble
|
|
333
|
333
|
wanteds /anywhere/ in the tree, via `insolubleWC`. That means we'll suppress all
|
|
334
|
334
|
less-important errors in favour of the more important (insolbule) ones
|
|
335
|
335
|
|
|
336
|
336
|
(SLIE2) But we need to take care: flags can turn errors into warnings, and we
|
|
337
|
337
|
don't want those warnings to suppress subsequent errors (including
|
|
338
|
338
|
suppressing the essential addTcEvBind for them: #15152). So in
|
|
339
|
|
- tryReporter we use askNoErrs to see if any error messages were
|
|
|
339
|
+ tryReporter we use askErrsFound to see if any error messages were
|
|
340
|
340
|
/actually/ produced; if not, we don't switch on suppression.
|
|
341
|
341
|
|
|
342
|
342
|
A consequence is that warnings never suppress warnings, so turning an
|
| ... |
... |
@@ -344,11 +344,11 @@ evidence bindings (as usual). It's used when more important errors have occurre |
|
344
|
344
|
previously suppressed. (e.g. partial-sigs/should_fail/T14584)
|
|
345
|
345
|
|
|
346
|
346
|
(SLIE3) There is a tricky interaction between
|
|
347
|
|
- * `cec_suppress` (a global flag) and
|
|
|
347
|
+ * `cec_outer_err` (a global flag) and
|
|
348
|
348
|
* `ei_suppress` (a local, per-error-item flag),
|
|
349
|
349
|
see Note [ei_suppress: suppressing confusing errors]
|
|
350
|
350
|
|
|
351
|
|
- Suppose the global `cec_suppress` is True because of an insoluble constraint
|
|
|
351
|
+ Suppose the global `cec_outer_err` is True because of an insoluble constraint
|
|
352
|
352
|
arising from a superclass constraint of an unsolved dictionary `[W] d::C a`.
|
|
353
|
353
|
This constraint will have ei_suppress=True. We must not suppress that less-insoluble
|
|
354
|
354
|
constraint `[W] d::C a`, lest we get no error at all (#18851).
|
| ... |
... |
@@ -379,23 +379,27 @@ Which errors should be suppressed? |
|
379
|
379
|
|
|
380
|
380
|
There are wrinkles
|
|
381
|
381
|
|
|
382
|
|
-(SCE3) In rare cases we may suppress /all/ errors. That is catastrophic: GHC proceeds
|
|
383
|
|
- to desugar and optimise the program, even though it is full of type errors (#22702,
|
|
384
|
|
- #22793), and/or we fail to bind evidence (#27731).
|
|
|
382
|
+(SCE3) In rare cases, `ei_suppress` may be True for /all/ errors in the Wanteds
|
|
|
383
|
+ of an implication. Then we may report no error at all. And if the entire
|
|
|
384
|
+ tree has this property (e.g. there is only one implication) we get
|
|
|
385
|
+ catastrophe: GHC proceeds to desugar and optimise the program, even though it
|
|
|
386
|
+ is full of type errors (#22702, #22793), and/or we fail to bind evidence
|
|
|
387
|
+ (#27731).
|
|
385
|
388
|
|
|
386
|
|
- If this happens, unless we are sure that an error will be reported some other way
|
|
387
|
|
- (details in the defn of `tidy_items` in `reportWanteds), we just un-suppress the lot,
|
|
388
|
|
- which is brutal but safe. It's a rare case.
|
|
|
389
|
+ Solution: if all the Wanted constraints of an implication have `ei_suppress` set,
|
|
|
390
|
+ just un-suppress all of them. Brutal but safe. It's a rare case.
|
|
389
|
391
|
|
|
390
|
392
|
How can it happen that there are /all/ errors are suppressed?
|
|
391
|
393
|
* See test T18851 for an example of how it is (just, barely) possible for the
|
|
392
|
394
|
/only/ errors to be superclass-of-Wanted constraints.
|
|
|
395
|
+
|
|
393
|
396
|
* Similarly #27731, which also involves a superclass-of-Wanted:
|
|
394
|
397
|
class (a ~ F b) => Ren a b
|
|
395
|
398
|
If we have a [W] Ren a b, we'll emit the superclass [W] a ~ F b, which will
|
|
396
|
399
|
rewrite the original class constraint to [W] Ren (F b) b. Now we have two
|
|
397
|
400
|
constraints: one has a non-empty rewriter set (SEC1) and one is a superclass of
|
|
398
|
401
|
a Wanted (SEC2).
|
|
|
402
|
+
|
|
399
|
403
|
* Also see Wrinkle (PER2) in Note [Prioritise Wanteds with empty
|
|
400
|
404
|
CoHoleSet] in GHC.Tc.Types.Constraint.
|
|
401
|
405
|
|
| ... |
... |
@@ -482,7 +486,7 @@ reportImplic ctxt implic@(Implic { ic_skols = tvs |
|
482
|
486
|
, cec_encl = implic' : cec_encl ctxt
|
|
483
|
487
|
|
|
484
|
488
|
-- NO LONGER NEEDED
|
|
485
|
|
--- , cec_suppress = cec_suppress ctxt
|
|
|
489
|
+-- , cec_outer_err = cec_outer_err ctxt
|
|
486
|
490
|
-- Suppress inessential errors if there
|
|
487
|
491
|
-- are insolubles anywhere in the
|
|
488
|
492
|
-- tree rooted here, or we've come across
|
| ... |
... |
@@ -542,6 +546,26 @@ reportBadTelescope ctxt env (ForAllSkol telescope) skols |
|
542
|
546
|
reportBadTelescope _ _ skol_info skols
|
|
543
|
547
|
= pprPanic "reportBadTelescope" (ppr skol_info $$ ppr skols)
|
|
544
|
548
|
|
|
|
549
|
+
|
|
|
550
|
+
|
|
|
551
|
+mkErrorItems :: SolverReportErrCtxt -> [Ct] -> TcM [ErrorItem]
|
|
|
552
|
+-- Turn each constraint into an ErrorItem
|
|
|
553
|
+-- Make sure that they aren't all suppressed via ei_suppress
|
|
|
554
|
+mkErrorItems ctxt cts
|
|
|
555
|
+ = do { items <- mapMaybeM mkErrorItem cts
|
|
|
556
|
+
|
|
|
557
|
+ -- Catch an awkward (and probably rare) case in which /all/ errors are
|
|
|
558
|
+ -- suppressed: see (SCE3) in Note [ei_suppress: suppressing confusing errors]
|
|
|
559
|
+ ; return (if need_to_unsuppress items
|
|
|
560
|
+ then map unsuppressErrorItem items
|
|
|
561
|
+ else items) }
|
|
|
562
|
+ where
|
|
|
563
|
+ need_to_unsuppress items
|
|
|
564
|
+ = not (cec_outer_err ctxt) -- Have not already reported an error
|
|
|
565
|
+ -- in an outer implication); see #21405
|
|
|
566
|
+ && not (any ignoreConstraint cts) -- No error is ignorable (is reported elsewhere)
|
|
|
567
|
+ && all ei_suppress items -- All errors are suppressed
|
|
|
568
|
+
|
|
545
|
569
|
-- | Makes an error item from a constraint, calculating whether or not the item
|
|
546
|
570
|
-- should be suppressed. See Note [Wanteds rewrite Wanteds: rewriter-sets]
|
|
547
|
571
|
-- in GHC.Tc.Types.Constraint. Returns Nothing if we should just ignore
|
| ... |
... |
@@ -573,9 +597,8 @@ mkErrorItem ct |
|
573
|
597
|
, ei_suppress = suppressCtError ev }}
|
|
574
|
598
|
|
|
575
|
599
|
-- | Actually report this 'ErrorItem'.
|
|
576
|
|
--- NOT NEEDED ANY MORE
|
|
577
|
|
---unsuppressErrorItem :: ErrorItem -> ErrorItem
|
|
578
|
|
--- unsuppressErrorItem ei = ei { ei_suppress = False }
|
|
|
600
|
+unsuppressErrorItem :: ErrorItem -> ErrorItem
|
|
|
601
|
+unsuppressErrorItem ei = ei { ei_suppress = False }
|
|
579
|
602
|
|
|
580
|
603
|
-- | Should we completely ignore this constraint in error reporting?
|
|
581
|
604
|
-- It *must* be the case that any constraint for which this returns True
|
| ... |
... |
@@ -651,39 +674,20 @@ reportWanteds ctxt tc_lvl wc@(WC { wc_simple = simples, wc_impl = implics |
|
651
|
674
|
| otherwise
|
|
652
|
675
|
= do { let tidy_cts = bagToList (mapBag (tidyCt env) simples)
|
|
653
|
676
|
tidy_errs = bagToList (mapBag (tidyDelayedError env) errs)
|
|
|
677
|
+ ; tidy_items <- mkErrorItems ctxt tidy_cts
|
|
654
|
678
|
|
|
655
|
|
- ; tidy_items1 <- mapMaybeM mkErrorItem tidy_cts
|
|
656
|
|
-
|
|
657
|
|
- -- Catch an awkward (and probably rare) case in which /all/ errors are
|
|
658
|
|
- -- suppressed: see (SCE3) in Note [ei_suppress: suppressing confusing errors]
|
|
659
|
|
--- ; errs_already <- ifErrsM (return True) (return False)
|
|
660
|
|
- ; let tidy_items
|
|
661
|
|
--- NO LONGER NEEDED
|
|
662
|
|
--- | not errs_already -- Have not already reported an error (perhaps
|
|
663
|
|
--- -- from an outer implication); see #21405
|
|
664
|
|
--- , not (any ignoreConstraint simples) -- No error is ignorable (is reported elsewhere)
|
|
665
|
|
--- , all ei_suppress tidy_items1 -- All errors are suppressed
|
|
666
|
|
--- = map unsuppressErrorItem tidy_items1
|
|
667
|
|
---
|
|
668
|
|
--- | otherwise
|
|
669
|
|
- = tidy_items1
|
|
670
|
|
-
|
|
671
|
|
- ; traceTc "reportWanteds 1" (vcat [ text "Simples =" <+> ppr simples
|
|
672
|
|
- , text "Suppress =" <+> ppr (cec_suppress ctxt)
|
|
|
679
|
+ ; traceTc "reportWanteds 1" (vcat [ text "Simples =" <+> ppr simples
|
|
|
680
|
+ , text "Suppress =" <+> ppr (cec_outer_err ctxt)
|
|
673
|
681
|
, text "tidy_cts =" <+> ppr tidy_cts
|
|
674
|
|
- , text "tidy_items1 =" <+> ppr tidy_items1
|
|
675
|
|
- , text "tidy_errs =" <+> ppr tidy_errs ])
|
|
|
682
|
+ , text "tidy_items =" <+> ppr tidy_items
|
|
|
683
|
+ , text "tidy_errs =" <+> ppr tidy_errs ])
|
|
676
|
684
|
|
|
677
|
685
|
; let (out_of_scope, other_holes, not_conc_errs, mult_co_errs)
|
|
678
|
686
|
= partition_errors tidy_errs
|
|
679
|
687
|
|
|
680
|
|
- -- Don't suppress out-of-scope errors
|
|
681
|
|
- -- See (SLIE0) in Note [cec_suppress: suppressing less-important error messages]
|
|
682
|
|
--- ctxt_for_scope_errs = ctxt { cec_suppress = False }
|
|
683
|
|
-
|
|
684
|
688
|
-- First, deal with any out-of-scope errors:
|
|
685
|
|
- ; (_, no_out_of_scope) <- askNoErrs $
|
|
686
|
|
- reportHoles ctxt tidy_items out_of_scope
|
|
|
689
|
+ ; (_, out_of_scope_errs) <- askErrsFound $
|
|
|
690
|
+ reportHoles ctxt tidy_items out_of_scope
|
|
687
|
691
|
|
|
688
|
692
|
-- Don't suppress holes or concreteness errors, ever
|
|
689
|
693
|
; reportHoles ctxt tidy_items other_holes
|
| ... |
... |
@@ -702,42 +706,49 @@ reportWanteds ctxt tc_lvl wc@(WC { wc_simple = simples, wc_impl = implics |
|
702
|
706
|
-- or Int ~ t a (AppTy on one side)
|
|
703
|
707
|
--
|
|
704
|
708
|
-- First visible ones, then invisible ones; but all serious
|
|
705
|
|
- ; let suppress_insols = not no_out_of_scope
|
|
706
|
|
- -- Serious errors are not suppressed by cec_suppress,
|
|
707
|
|
- -- hence not including cec_suppress in suppress_insols
|
|
708
|
|
- -- See (SLIE0) in Note [cec_suppress: suppressing less-important
|
|
709
|
|
- -- error messages]
|
|
|
709
|
+ ; let suppress_insols = out_of_scope_errs
|
|
|
710
|
+ -- Serious errors are not suppressed by cec_outer_err,
|
|
|
711
|
+ -- hence not including cec_outer_err in suppress_insols
|
|
|
712
|
+ -- See (SLIE0) in Note [cec_outer_err: suppressing less-important
|
|
|
713
|
+ -- error messages]
|
|
710
|
714
|
(vis_items, invis_items)
|
|
711
|
715
|
= partition (isVisibleOrigin . errorItemOrigin) tidy_items
|
|
712
|
716
|
|
|
713
|
|
- ; (vis_items1, no_vis_serious_errs)
|
|
714
|
|
- <- askNoErrs $
|
|
|
717
|
+ ; (vis_items1, vis_serious_errs)
|
|
|
718
|
+ <- askErrsFound $
|
|
715
|
719
|
tryReporters ctxt suppress_insols serious_reporters vis_items
|
|
716
|
720
|
|
|
717
|
|
- ; let suppress_invis = suppress_insols || not no_vis_serious_errs
|
|
718
|
|
- ; (invis_items1, no_invis_serious_errs)
|
|
719
|
|
- <- askNoErrs $
|
|
|
721
|
+ ; let suppress_invis = suppress_insols || vis_serious_errs
|
|
|
722
|
+ ; (invis_items1, invis_serious_errs)
|
|
|
723
|
+ <- askErrsFound $
|
|
720
|
724
|
tryReporters ctxt suppress_invis serious_reporters invis_items
|
|
721
|
725
|
|
|
722
|
|
- -- Now take account of the inherited cec_suppress, and augment it
|
|
|
726
|
+ -- Now take account of the inherited cec_outer_err, and augment it
|
|
723
|
727
|
-- to suppress further errors if we have found any serious errors locally
|
|
724
|
|
- ; let suppress_rest = cec_suppress ctxt
|
|
|
728
|
+ ; let suppress_implics = cec_outer_err ctxt
|
|
725
|
729
|
|| suppress_invis
|
|
726
|
|
- || not no_invis_serious_errs
|
|
727
|
|
-
|
|
728
|
|
- -- Next, deal with the less-serious constraints
|
|
|
730
|
+ || invis_serious_errs
|
|
|
731
|
+ ctxt_for_implics = ctxt { cec_outer_err = suppress_implics }
|
|
|
732
|
+ (insol_implics, other_implics) = partitionBag insolubleImplic implics
|
|
|
733
|
+
|
|
|
734
|
+ -- Next, deal with the insoluble implications
|
|
|
735
|
+ ; (_, implic_errs)
|
|
|
736
|
+ <- askErrsFound $ mapBagM_ (reportImplic ctxt_for_implics) insol_implics
|
|
|
737
|
+
|
|
|
738
|
+ -- Finally, deal with the less-serious constraints,
|
|
|
739
|
+ -- both local and implications
|
|
|
740
|
+ -- suppressing if any errors have been reported so far
|
|
|
741
|
+ ; let suppress_rest = suppress_implics || implic_errs
|
|
|
742
|
+ ctxt_for_rest = ctxt { cec_outer_err = suppress_rest }
|
|
729
|
743
|
; leftovers <- tryReporters ctxt suppress_rest less_serious_reporters $
|
|
730
|
744
|
(vis_items1 ++ invis_items1)
|
|
|
745
|
+ ; mapBagM_ (reportImplic ctxt_for_rest) other_implics
|
|
|
746
|
+
|
|
|
747
|
+ -- Check that we have covered all the constraints
|
|
731
|
748
|
; massertPpr (null leftovers)
|
|
732
|
749
|
(text "The following unsolved Wanted constraints \
|
|
733
|
750
|
\have not been reported to the user:"
|
|
734
|
751
|
$$ ppr leftovers)
|
|
735
|
|
-
|
|
736
|
|
- ; let ctxt_for_rest = ctxt { cec_suppress = suppress_rest }
|
|
737
|
|
- ; mapBagM_ (reportImplic ctxt_for_rest) implics
|
|
738
|
|
- -- NB ctxt2: don't suppress inner insolubles if there's only a
|
|
739
|
|
- -- wanted insoluble here; but do suppress inner insolubles
|
|
740
|
|
- -- if there's a *given* insoluble here (= inaccessible code)
|
|
741
|
752
|
}
|
|
742
|
753
|
where
|
|
743
|
754
|
env = cec_tidy ctxt
|
| ... |
... |
@@ -758,7 +769,7 @@ reportWanteds ctxt tc_lvl wc@(WC { wc_simple = simples, wc_impl = implics |
|
758
|
769
|
DE_Multiplicity mult_co loc
|
|
759
|
770
|
-> (es1, es2, es3, (mult_co, loc):es4)
|
|
760
|
771
|
|
|
761
|
|
- --serious_reporters: ones that should *not* be suppressed by cec_suppress,
|
|
|
772
|
+ --serious_reporters: ones that should *not* be suppressed by cec_outer_err,
|
|
762
|
773
|
-- (i.e. by an insoluble somewhere else in the tree)
|
|
763
|
774
|
serious_reporters
|
|
764
|
775
|
= [ -- We put implicit lifting errors first, because are solid errors
|
| ... |
... |
@@ -1054,7 +1065,7 @@ reportHoles :: SolverReportErrCtxt |
|
1054
|
1065
|
-> [ErrorItem] -- Other (tidied) constraints
|
|
1055
|
1066
|
-> [Hole] -- Holes to report
|
|
1056
|
1067
|
-> TcM ()
|
|
1057
|
|
--- Ignores cec_suppress
|
|
|
1068
|
+-- Ignores cec_outer_err
|
|
1058
|
1069
|
reportHoles ctxt tidy_items holes
|
|
1059
|
1070
|
= do
|
|
1060
|
1071
|
diag_opts <- initDiagOpts <$> getDynFlags
|
| ... |
... |
@@ -1110,7 +1121,7 @@ zonkTidyTcLclEnvs tidy_env lcls = foldM go (tidy_env, emptyNameEnv) (concatMap c |
|
1110
|
1121
|
return (tidy_env', extendNameEnv name_env name tidy_ty)
|
|
1111
|
1122
|
|
|
1112
|
1123
|
reportNotConcreteErrs :: SolverReportErrCtxt -> [NotConcreteError] -> TcM ()
|
|
1113
|
|
--- Ignores cec_suppress
|
|
|
1124
|
+-- Ignores cec_outer_err
|
|
1114
|
1125
|
reportNotConcreteErrs _ [] = return ()
|
|
1115
|
1126
|
reportNotConcreteErrs ctxt errs@(err0:_)
|
|
1116
|
1127
|
= do { msg <- mkErrorReport (ctLocEnv (nce_loc err0)) diag (Just ctxt) [] []
|
| ... |
... |
@@ -1311,7 +1322,7 @@ reportGroup mk_err ctxt items |
|
1311
|
1322
|
; err <- mk_err items
|
|
1312
|
1323
|
; traceTc "About to maybeReportErr" $
|
|
1313
|
1324
|
vcat [ text "Constraint:" <+> ppr items
|
|
1314
|
|
- , text "cec_suppress =" <+> ppr (cec_suppress ctxt)
|
|
|
1325
|
+ , text "cec_outer_err =" <+> ppr (cec_outer_err ctxt)
|
|
1315
|
1326
|
, text "cec_defer_type_errors =" <+> ppr (cec_defer_type_errors ctxt) ]
|
|
1316
|
1327
|
|
|
1317
|
1328
|
; maybeReportError ctxt items err
|
| ... |
... |
@@ -1360,9 +1371,9 @@ maybeReportError ctxt items@(item1:|_) (SolverReport { sr_important_msg = import |
|
1360
|
1371
|
-- T @X1 T1 ~ T @X2 T2 gives two insolubles: X1~X2 and T1~T2 (KindVType, T17380, T22332b)
|
|
1361
|
1372
|
--
|
|
1362
|
1373
|
-- | any ei_insoluble items
|
|
1363
|
|
--- = False -- Don't suppress insolubles even if cec_suppress is True
|
|
|
1374
|
+-- = False -- Don't suppress insolubles even if cec_outer_err is True
|
|
1364
|
1375
|
|
|
1365
|
|
- | cec_suppress ctxt
|
|
|
1376
|
+ | cec_outer_err ctxt
|
|
1366
|
1377
|
= True -- Some earlier error has occurred, so suppress this diagnostic
|
|
1367
|
1378
|
|
|
1368
|
1379
|
| all ei_suppress items
|
| ... |
... |
@@ -1431,7 +1442,7 @@ mkErrorTerm ct_loc ty ctxt msg supp hints |
|
1431
|
1442
|
|
|
1432
|
1443
|
tryReporters :: SolverReportErrCtxt
|
|
1433
|
1444
|
-> Bool -- Suppress errors if this is True
|
|
1434
|
|
- -- (over-riding cec_suppress)
|
|
|
1445
|
+ -- (over-riding cec_outer_err)
|
|
1435
|
1446
|
-> [ReporterSpec]
|
|
1436
|
1447
|
-> [ErrorItem]
|
|
1437
|
1448
|
-> TcM [ErrorItem]
|
| ... |
... |
@@ -1442,8 +1453,8 @@ tryReporters ctxt suppress reporters items |
|
1442
|
1453
|
; traceTc "tryReporters }" (ppr items')
|
|
1443
|
1454
|
; return items' }
|
|
1444
|
1455
|
where
|
|
1445
|
|
- -- Use `suppress` to set the `cec_supress` flag for these items
|
|
1446
|
|
- ctxt_w_suppress = ctxt { cec_suppress = suppress }
|
|
|
1456
|
+ -- Use `suppress` to set the `cec_outer_err` flag for these items
|
|
|
1457
|
+ ctxt_w_suppress = ctxt { cec_outer_err = suppress }
|
|
1447
|
1458
|
go [] items = return items
|
|
1448
|
1459
|
go (r:rs) items = do { items' <- tryReporter ctxt_w_suppress r items
|
|
1449
|
1460
|
; go rs items' }
|
| ... |
... |
@@ -1490,7 +1501,7 @@ mkErrorReport tcl_env msg mb_ctxt supp hints |
|
1490
|
1501
|
{- Note [Always warn with -fdefer-type-errors]
|
|
1491
|
1502
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
1492
|
1503
|
When -fdefer-type-errors is on we warn about *all* type errors, even
|
|
1493
|
|
-if cec_suppress is on. This can lead to a lot more warnings than you
|
|
|
1504
|
+if cec_outer_err is on. This can lead to a lot more warnings than you
|
|
1494
|
1505
|
would get errors without -fdefer-type-errors, but if we suppress any of
|
|
1495
|
1506
|
them you might get a runtime error that wasn't warned about at compile
|
|
1496
|
1507
|
time.
|
| ... |
... |
@@ -1550,8 +1561,8 @@ mkIrredErr ctxt items |
|
1550
|
1561
|
|
|
1551
|
1562
|
{- Note [Constructing Hole Errors]
|
|
1552
|
1563
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
1553
|
|
-Whether or not 'mkHoleError' returns an error is not influenced by cec_suppress. In other terms,
|
|
1554
|
|
-these "hole" errors are /not/ suppressed by cec_suppress. We want to see them!
|
|
|
1564
|
+Whether or not 'mkHoleError' returns an error is not influenced by cec_outer_err. In other terms,
|
|
|
1565
|
+these "hole" errors are /not/ suppressed by cec_outer_err. We want to see them!
|
|
1555
|
1566
|
|
|
1556
|
1567
|
There are two cases to consider:
|
|
1557
|
1568
|
|