aboutsummaryrefslogtreecommitdiffhomepage
path: root/vernac
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2017-11-23 18:08:49 +0100
committerGravatar Maxime Dénès <mail@maximedenes.fr>2017-11-23 18:08:49 +0100
commit167c52c6a15db5e094835244aff3ba76c78b391e (patch)
tree550a25dd9fe910868b233a66dd4dd33bca943343 /vernac
parent915554785ffed11370f5d700d11a8b5614408096 (diff)
parent2db70092d63065be8a5902764e0d1d5f1ea01e6c (diff)
Merge PR #6203: Fix universe polymorphic Program obligations.
Diffstat (limited to 'vernac')
-rw-r--r--vernac/obligations.ml4
1 files changed, 4 insertions, 0 deletions
diff --git a/vernac/obligations.ml b/vernac/obligations.ml
index ed4d8b888..a44de66e9 100644
--- a/vernac/obligations.ml
+++ b/vernac/obligations.ml
@@ -678,6 +678,7 @@ let init_prog_info ?(opaque = false) sign n udecl b t ctx deps fixkind
obl_deps = d; obl_tac = tac })
obls, b
in
+ let ctx = UState.make_flexible_nonalgebraic ctx in
{ prg_name = n ; prg_body = b; prg_type = reduce t;
prg_ctx = ctx; prg_univdecl = udecl;
prg_obligations = (obls', Array.length obls');
@@ -841,6 +842,9 @@ let obligation_terminator name num guard hook auto pf =
Inductiveops.control_only_guard (Global.env ()) body;
(** Declare the obligation ourselves and drop the hook *)
let prg = get_info (ProgMap.find name !from_prg) in
+ (** Ensure universes are substituted properly in body and type *)
+ let body = EConstr.to_constr sigma (EConstr.of_constr body) in
+ let ty = Option.map (fun x -> EConstr.to_constr sigma (EConstr.of_constr x)) ty in
let ctx = Evd.evar_universe_context sigma in
let prg = { prg with prg_ctx = ctx } in
let obls, rem = prg.prg_obligations in