From c93d5094bff73498ec8fc02837e16cc5ce9103b6 Mon Sep 17 00:00:00 2001 From: Gaƫtan Gilbert Date: Thu, 7 Sep 2017 16:56:34 +0200 Subject: Make restrict_universe_context stronger. This fixes BZ#5717. Also add a test and fix a changed test. --- proofs/proof_global.ml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'proofs') diff --git a/proofs/proof_global.ml b/proofs/proof_global.ml index cf5dc95fe..aa5621770 100644 --- a/proofs/proof_global.ml +++ b/proofs/proof_global.ml @@ -346,9 +346,14 @@ let close_proof ~keep_body_ucst_separate ?feedback_id ~now if not (keep_body_ucst_separate || not (Safe_typing.empty_private_constants = eff)) then nf t else t - in + in let used_univs_body = Univops.universes_of_constr body in let used_univs_typ = Univops.universes_of_constr typ in + (* Universes for private constants are relevant to the body *) + let used_univs_body = + List.fold_left (fun acc (us,_) -> Univ.LSet.union acc us) + used_univs_body (Safe_typing.universes_of_private eff) + in if keep_body_ucst_separate || not (Safe_typing.empty_private_constants = eff) then let initunivs = UState.const_univ_entry ~poly initial_euctx in -- cgit v1.2.3