aboutsummaryrefslogtreecommitdiff
path: root/vernac/comHints.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2020-10-02 19:01:46 +0200
committerPierre-Marie Pédrot2020-11-04 13:43:57 +0100
commitbe332604f4d495ea875185ff1b5aee1eb12b4178 (patch)
tree774c39fa9b256d736d48c5ec386025171fc3caae /vernac/comHints.ml
parent511a3eae36d3b57afbbb37b586ef71adf094f8ca (diff)
Opacify the Hints.hint_term type.
Diffstat (limited to 'vernac/comHints.ml')
-rw-r--r--vernac/comHints.ml21
1 files changed, 9 insertions, 12 deletions
diff --git a/vernac/comHints.ml b/vernac/comHints.ml
index b5e53208ca..6cc1940b40 100644
--- a/vernac/comHints.ml
+++ b/vernac/comHints.ml
@@ -62,7 +62,7 @@ let project_hint ~poly pri l2r r =
cb
in
let info = {Typeclasses.hint_priority = pri; hint_pattern = None} in
- (info, true, Hints.PathAny, Hints.IsGlobRef (GlobRef.ConstRef c))
+ (info, true, Hints.PathAny, Hints.hint_globref (GlobRef.ConstRef c))
let warn_deprecated_hint_constr =
CWarnings.create ~name:"fragile-hint-constr" ~category:"automation"
@@ -84,14 +84,6 @@ let soft_evaluable =
let interp_hints ~poly h =
let env = Global.env () in
let sigma = Evd.from_env env in
- let f poly c =
- let env = Global.env () in
- let sigma = Evd.from_env env in
- let evd, c = Constrintern.interp_open_constr env sigma c in
- let h, diff = Hints.hint_constr env sigma ~poly (evd, c) in
- let () = DeclareUctx.declare_universe_context ~poly:false diff [@ocaml.warning "-3"] in
- h
- in
let fref r =
let gr = Smartlocate.global_with_alias r in
Dumpglob.add_glob ?loc:r.CAst.loc gr;
@@ -104,10 +96,15 @@ let interp_hints ~poly h =
match c with
| HintsReference c ->
let gr = Smartlocate.global_with_alias c in
- (PathHints [gr], IsGlobRef gr)
+ (PathHints [gr], hint_globref gr)
| HintsConstr c ->
let () = warn_deprecated_hint_constr () in
- (PathAny, f poly c)
+ let env = Global.env () in
+ let sigma = Evd.from_env env in
+ let evd, c = Constrintern.interp_open_constr env sigma c in
+ let h, diff = Hints.hint_constr env sigma ~poly (evd, c) in
+ let () = DeclareUctx.declare_universe_context ~poly:false diff [@ocaml.warning "-3"] in
+ (PathAny, h)
in
let fp = Constrintern.intern_constr_pattern env sigma in
let fres (info, b, r) =
@@ -147,7 +144,7 @@ let interp_hints ~poly h =
( empty_hint_info
, true
, PathHints [gr]
- , IsGlobRef gr ))
+ , hint_globref gr ))
in
HintsResolveEntry (List.flatten (List.map constr_hints_of_ind lqid))
| HintsExtern (pri, patcom, tacexp) ->