aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
authorGaëtan Gilbert2020-03-10 14:19:30 +0100
committerGaëtan Gilbert2020-03-10 14:19:30 +0100
commitcffb0ed6f58188b8ea01d54a5349d28313b86dc1 (patch)
tree21c770ded4937e00419947f4ae31840217ce4978 /pretyping
parentf1188b9a3f32eef7657bb46026447718f6fb6055 (diff)
parent74df1a17d7d58d4fa99de58899e08de5bbe97810 (diff)
Merge PR #11764: Simplify mutual template polymorphism
Reviewed-by: SkySkimmer
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/evarsolve.ml6
-rw-r--r--pretyping/inductiveops.ml6
2 files changed, 8 insertions, 4 deletions
diff --git a/pretyping/evarsolve.ml b/pretyping/evarsolve.ml
index aafd662f7d..c9ccd668ca 100644
--- a/pretyping/evarsolve.ml
+++ b/pretyping/evarsolve.ml
@@ -78,9 +78,9 @@ let get_polymorphic_positions env sigma f =
match EConstr.kind sigma f with
| Ind (ind, u) | Construct ((ind, _), u) ->
let mib,oib = Inductive.lookup_mind_specif env ind in
- (match oib.mind_arity with
- | RegularArity _ -> assert false
- | TemplateArity templ -> templ.template_param_levels)
+ (match mib.mind_template with
+ | None -> assert false
+ | Some templ -> templ.template_param_levels)
| _ -> assert false
let refresh_universes ?(status=univ_rigid) ?(onlyalg=false) ?(refreshset=false)
diff --git a/pretyping/inductiveops.ml b/pretyping/inductiveops.ml
index a4406aeba1..01994a35c7 100644
--- a/pretyping/inductiveops.ml
+++ b/pretyping/inductiveops.ml
@@ -681,13 +681,17 @@ let type_of_inductive_knowing_conclusion env sigma ((mib,mip),u) conclty =
match mip.mind_arity with
| RegularArity s -> sigma, EConstr.of_constr (subst_instance_constr u s.mind_user_arity)
| TemplateArity ar ->
+ let templ = match mib.mind_template with
+ | None -> assert false
+ | Some t -> t
+ in
let _,scl = splay_arity env sigma conclty in
let scl = EConstr.ESorts.kind sigma scl in
let ctx = List.rev mip.mind_arity_ctxt in
let evdref = ref sigma in
let ctx =
instantiate_universes
- env evdref scl ar.template_level (ctx,ar.template_param_levels) in
+ env evdref scl ar.template_level (ctx,templ.template_param_levels) in
!evdref, EConstr.of_constr (mkArity (List.rev ctx,scl))
let type_of_projection_constant env (p,u) =