@@ -535,18 +535,24 @@ let get_instance (env: Environ.env) (sigma: Evd.evar_map) (tc : GlobRef.t) (inst
535535 in
536536 instances_grefs2istance instance
537537
538+ let warning_tc_hints = CWarnings. create ~name: " TC.hints" ~category: elpi_cat Pp. str
539+
538540let get_instances (env : Environ.env ) (sigma : Evd.evar_map ) tc : type_class_instance list =
539541 let hint_db = Hints. searchtable_map " typeclass_instances" in
540542 let secvars : Names.Id.Pred.t = Names.Id.Pred. full in
541543 let full_hints = Hints.Hint_db. map_all ~secvars: secvars tc hint_db in
542- let hint_asts = List. map Hints.FullHint. repr full_hints in
543- let hints = List. filter_map (function
544- | Hints. Res_pf a -> Some a
545- | ERes_pf a -> Some a
546- | Extern (a , b ) -> None
547- | Give_exact a -> Some a
548- | Res_pf_THEN_trivial_fail e -> Some e
549- | Unfold_nth e -> None ) hint_asts in
544+ (* let hint_asts = List.map Hints.FullHint.repr full_hints in *)
545+ let hints = List. filter_map (fun (e : Hints.FullHint.t ) -> match Hints.FullHint. repr e with
546+ | Hints. Res_pf a | ERes_pf a | Give_exact a -> Some a (* Respectively Hint Apply | EApply | Exact *)
547+ | Extern _ ->
548+ warning_tc_hints (Printf. sprintf " There is an hint extern in the typeclass db: \n %s" (Pp. string_of_ppcmds @@ Hints.FullHint. print env sigma e));
549+ None
550+ | Res_pf_THEN_trivial_fail _ -> (* Hint Immediate *)
551+ warning_tc_hints (Printf. sprintf " There is an hint immediate in the typeclass db: \n %s" (Pp. string_of_ppcmds @@ Hints.FullHint. print env sigma e));
552+ None
553+ | Unfold_nth _ ->
554+ warning_tc_hints (Printf. sprintf " There is an hint unfold in the typeclass db: \n %s" (Pp. string_of_ppcmds @@ Hints.FullHint. print env sigma e));
555+ None ) full_hints in
550556 let constrs = List. map (fun a -> Hints. hint_as_term a |> snd) hints in
551557 (* Printer.pr_global tc |> Pp.string_of_ppcmds |> Printf.printf "%s\n"; *)
552558 let instances_grefs = List. filter_map (fun e ->
0 commit comments