aboutsummaryrefslogtreecommitdiff
path: root/vernac
diff options
context:
space:
mode:
authorGaëtan Gilbert2019-01-08 15:57:27 +0100
committerGaëtan Gilbert2019-01-30 12:49:28 +0100
commitf6613489304a30846af28334c040c7d4f9e4addc (patch)
tree1b5e600288190926ee4be95ba40a1d071060e7c6 /vernac
parenta9b141469fe3036355be95d8cf5f0bf5c240fe37 (diff)
Restrict universes in records.
Fix #8076.
Diffstat (limited to 'vernac')
-rw-r--r--vernac/record.ml19
1 files changed, 10 insertions, 9 deletions
diff --git a/vernac/record.ml b/vernac/record.ml
index 2867ad1437..6f1db8bf69 100644
--- a/vernac/record.ml
+++ b/vernac/record.ml
@@ -176,19 +176,20 @@ let typecheck_params_and_fields finite def poly pl ps records =
else sigma, typ
in
let (sigma, typs) = List.fold_left2_map fold sigma typs data in
- let sigma = Evd.minimize_universes sigma in
- let newps = List.map (EConstr.to_rel_decl sigma) newps in
+ let sigma, (newps, ans) = Evarutil.finalize sigma (fun nf ->
+ let newps = List.map (RelDecl.map_constr_het nf) newps in
+ let map (impls, newfs) typ =
+ let newfs = List.map (RelDecl.map_constr_het nf) newfs in
+ let typ = nf typ in
+ (typ, impls, newfs)
+ in
+ let ans = List.map2 map data typs in
+ newps, ans)
+ in
let univs = Evd.check_univ_decl ~poly sigma decl in
let ubinders = Evd.universe_binders sigma in
let ce t = Pretyping.check_evars env0 (Evd.from_env env0) sigma (EConstr.of_constr t) in
let () = List.iter (iter_constr ce) (List.rev newps) in
- let map (impls, newfs) typ =
- let newfs = List.map (EConstr.to_rel_decl sigma) newfs in
- let typ = EConstr.to_constr sigma typ in
- List.iter (iter_constr ce) (List.rev newfs);
- (typ, impls, newfs)
- in
- let ans = List.map2 map data typs in
ubinders, univs, template, newps, imps, ans
type record_error =