| ... |
... |
@@ -652,13 +652,12 @@ reportWanteds ctxt tc_lvl wc@(WC { wc_simple = simples, wc_impl = implics |
|
652
|
652
|
]
|
|
653
|
653
|
|
|
654
|
654
|
-- report2: we suppress these if there are insolubles elsewhere in the tree
|
|
655
|
|
- report2 = [ ("Implicit params", is_ip, False, mkGroupReporter mkIPErr)
|
|
656
|
|
- , ("Irreds", is_irred, False, mkGroupReporter mkIrredErr)
|
|
|
655
|
+ report2 = [ ("Irreds", is_irred, False, mkGroupReporter mkIrredErr)
|
|
657
|
656
|
, ("Dicts", is_dict, False, mkGroupReporter mkDictErr)
|
|
658
|
657
|
, ("Quantified", is_qc, False, mkGroupReporter mkQCErr) ]
|
|
659
|
658
|
|
|
660
|
659
|
-- rigid_nom_eq, rigid_nom_tv_eq,
|
|
661
|
|
- is_dict, is_equality, is_ip, is_FRR, is_irred :: ErrorItem -> Pred -> Bool
|
|
|
660
|
+ is_dict, is_equality, is_FRR, is_irred :: ErrorItem -> Pred -> Bool
|
|
662
|
661
|
|
|
663
|
662
|
is_given_eq item pred
|
|
664
|
663
|
| Given <- ei_flavour item
|
| ... |
... |
@@ -716,9 +715,6 @@ reportWanteds ctxt tc_lvl wc@(WC { wc_simple = simples, wc_impl = implics |
|
716
|
715
|
is_dict _ (ClassPred {}) = True
|
|
717
|
716
|
is_dict _ _ = False
|
|
718
|
717
|
|
|
719
|
|
- is_ip _ (ClassPred cls _) = isIPClass cls
|
|
720
|
|
- is_ip _ _ = False
|
|
721
|
|
-
|
|
722
|
718
|
is_irred _ (IrredPred {}) = True
|
|
723
|
719
|
is_irred _ _ = False
|
|
724
|
720
|
|
| ... |
... |
@@ -1687,17 +1683,6 @@ givenConstraints ctxt |
|
1687
|
1683
|
|
|
1688
|
1684
|
----------------
|
|
1689
|
1685
|
|
|
1690
|
|
-mkIPErr :: SolverReportErrCtxt -> NonEmpty ErrorItem -> TcM SolverReport
|
|
1691
|
|
--- What would happen if an item is suppressed because of
|
|
1692
|
|
--- Note [Wanteds rewrite Wanteds: rewriter-sets] in GHC.Tc.Types.Constraint?
|
|
1693
|
|
--- Very unclear what's best. Let's not worry about this.
|
|
1694
|
|
-mkIPErr ctxt (item1:|others)
|
|
1695
|
|
- = do { (ctxt, binds, item1) <- relevantBindings True ctxt item1
|
|
1696
|
|
- ; let msg = important ctxt $ UnboundImplicitParams (item1 :| others)
|
|
1697
|
|
- ; return $ add_relevant_bindings binds msg }
|
|
1698
|
|
-
|
|
1699
|
|
-----------------
|
|
1700
|
|
-
|
|
1701
|
1686
|
-- | Report a representation-polymorphism error to the user:
|
|
1702
|
1687
|
-- a type is required to have a fixed runtime representation,
|
|
1703
|
1688
|
-- but doesn't.
|
| ... |
... |
@@ -2308,7 +2293,15 @@ mkQCErr ctxt items |
|
2308
|
2293
|
|
|
2309
|
2294
|
|
|
2310
|
2295
|
mkDictErr :: HasDebugCallStack => SolverReportErrCtxt -> NonEmpty ErrorItem -> TcM SolverReport
|
|
2311
|
|
-mkDictErr ctxt orig_items
|
|
|
2296
|
+-- Includes implict parameters
|
|
|
2297
|
+mkDictErr ctxt orig_items@(item1 :| others)
|
|
|
2298
|
+ | ClassPred cls tys <- classifyPredType (errorItemPred item1)
|
|
|
2299
|
+ , isIPClass cls -- Implicit parameters; no need to look in global instance envts
|
|
|
2300
|
+ = do { (ctxt, binds, item1) <- relevantBindings True ctxt item1
|
|
|
2301
|
+ ; let msg = important ctxt $ UnboundImplicitParams (item1 :| others)
|
|
|
2302
|
+ ; return $ add_relevant_bindings binds msg }
|
|
|
2303
|
+
|
|
|
2304
|
+ | otherwise
|
|
2312
|
2305
|
= do { inst_envs <- tcGetInstEnvs
|
|
2313
|
2306
|
; let min_items = elim_superclasses items
|
|
2314
|
2307
|
lookups = map (lookup_cls_inst inst_envs) min_items
|
| ... |
... |
@@ -2362,8 +2355,8 @@ mk_dict_err ctxt (item, (matches, pot_unifiers, unsafe_overlapped)) |
|
2362
|
2355
|
{ (_, rel_binds, item) <- relevantBindings True ctxt item
|
|
2363
|
2356
|
; candidate_insts <- get_candidate_instances
|
|
2364
|
2357
|
; mb_noBuiltinInst_msg <- getNoBuiltinInstMsg item
|
|
2365
|
|
- ; return $
|
|
2366
|
|
- CannotResolveInstance item unifiers candidate_insts rel_binds mb_noBuiltinInst_msg
|
|
|
2358
|
+ ; return $ CannotResolveInstance item unifiers candidate_insts rel_binds
|
|
|
2359
|
+ mb_noBuiltinInst_msg
|
|
2367
|
2360
|
}
|
|
2368
|
2361
|
|
|
2369
|
2362
|
-- Some matches => overlap errors
|