diff options
author | Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net> | 2017-09-18 14:50:07 +0200 |
---|---|---|
committer | Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net> | 2017-11-24 19:21:18 +0100 |
commit | 58c0784745f8b2ba7523f246c4611d780c9f3f70 (patch) | |
tree | fb629961a496e4c84491b4e433a9829621179ca6 /plugins/ltac/rewrite.ml | |
parent | 02e6d7f39e3dc2aa8859274bc69b2edf8cc91feb (diff) |
When declaring constants/inductives use ContextSet if monomorphic.
Also use constant_universes_entry instead of a bool flag to indicate
polymorphism in ParameterEntry.
There are a few places where we convert back to ContextSet because
check_univ_decl returns a UContext, this could be improved.
Diffstat (limited to 'plugins/ltac/rewrite.ml')
-rw-r--r-- | plugins/ltac/rewrite.ml | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/ltac/rewrite.ml b/plugins/ltac/rewrite.ml index f6523d28c..a2f5a4577 100644 --- a/plugins/ltac/rewrite.ml +++ b/plugins/ltac/rewrite.ml @@ -1972,9 +1972,13 @@ let add_morphism_infer glob m n = let evd = Evd.from_env env in let uctx, instance = build_morphism_signature env evd m in if Lib.is_modtype () then + let uctx = if poly + then Entries.Polymorphic_const_entry (UState.context uctx) + else Entries.Monomorphic_const_entry (UState.context_set uctx) + in let cst = Declare.declare_constant ~internal:Declare.InternalTacticRequest instance_id (Entries.ParameterEntry - (None,poly,(instance,UState.context uctx),None), + (None,(instance,uctx),None), Decl_kinds.IsAssumption Decl_kinds.Logical) in add_instance (Typeclasses.new_instance |