diff options
author | 2016-10-24 18:18:33 +0200 | |
---|---|---|
committer | 2016-11-03 16:26:27 +0100 | |
commit | d6fe6773c959493ed97108e1032b1bd8c1e78081 (patch) | |
tree | 69d1cb3e8aaf0b1800c0c09b22f70c162948f7d7 /toplevel/record.ml | |
parent | 6ec511721efc9235f6c2fa922a21dcb9b041bbfd (diff) |
Lets Hints/Instances take an optional pattern
In addition to a priority, cleanup the interfaces for passing this
information as well. The pattern, if given, takes priority over the
inferred one.
We only allow Existing Instances gr ... gr | pri. for now, without
pattern, as before.
Make the API compatible to 8.5 as well.
Diffstat (limited to 'toplevel/record.ml')
-rw-r--r-- | toplevel/record.ml | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/toplevel/record.ml b/toplevel/record.ml index 9c4d41ea5..63564fba1 100644 --- a/toplevel/record.ml +++ b/toplevel/record.ml @@ -565,8 +565,9 @@ let definition_structure (kind,poly,finite,(is_coe,((loc,idstruc),pl)),ps,cfs,id typecheck_params_and_fields (kind = Class true) idstruc pl s ps notations fs) () in let sign = structure_signature (fields@params) in let gr = match kind with - | Class def -> - let gr = declare_class finite def poly ctx (loc,idstruc) idbuild + | Class def -> + let priorities = List.map (fun id -> {hint_priority = id; hint_pattern = None}) priorities in + let gr = declare_class finite def poly ctx (loc,idstruc) idbuild implpars params arity template implfs fields is_coe coers priorities sign in gr | _ -> |