Skip to content

Commit d04f191

Browse files
committed
fix(attempt): Return evd from make_recursive_bodies
1 parent 878074c commit d04f191

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

vernac/declare.ml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ let make_recursive_bodies ?sigma env ~typing_flags ~possible_guard ~rec_declarat
10421042
let mkbody i = match indexes with
10431043
| Some indexes -> Constr.mkFix ((indexes,i), rec_declaration)
10441044
| None -> Constr.mkCoFix (i, rec_declaration) in
1045-
List.map_i (fun i typ -> (mkbody i, typ)) 0 (Array.to_list (pi2 rec_declaration)), indexes
1045+
List.map_i (fun i typ -> (mkbody i, typ)) 0 (Array.to_list (pi2 rec_declaration)), sigma, indexes
10461046

10471047
let prepare_recursive_declaration cinfo fixtypes fixrs fixdefs =
10481048
let fixnames = List.map (fun CInfo.{name} -> name) cinfo in
@@ -1064,7 +1064,7 @@ let declare_mutual_definitions ~info ~cinfo ~opaque ~eff ~uctx ~bodies ~possible
10641064
let fixtypes = List.map (fun CInfo.{typ} -> typ) cinfo in
10651065
let rec_declaration = prepare_recursive_declaration cinfo fixtypes fixrelevances bodies in
10661066
let sigma = Some (Evd.from_ctx uctx) in
1067-
let bodies_types, indexes = make_recursive_bodies ?sigma env ~typing_flags ~rec_declaration ~possible_guard in
1067+
let bodies_types, sigma, indexes = make_recursive_bodies ?sigma env ~typing_flags ~rec_declaration ~possible_guard in
10681068
let entries = List.map (fun (body, typ) -> (body, Some typ)) bodies_types in
10691069
let entries_for_using = List.map (fun (body, typ) -> (body, Some typ)) bodies_types in
10701070
let using = interp_mutual_using env cinfo entries_for_using using in
@@ -2098,15 +2098,17 @@ let prepare_proof ?(warn_incomplete=true) { proof; pinfo; sideff } =
20982098
| None -> raise_non_ground_proof evd pid c
20992099
in
21002100
let proofs = List.map (fun (_, body, typ) -> (to_constr body, to_constr typ)) initial_goals in
2101-
let proofs = match pinfo.possible_guard with
2102-
| None -> proofs
2101+
let proofs, evd = match pinfo.possible_guard with
2102+
| None -> proofs, evd
21032103
| Some (possible_guard, fixrelevances) ->
21042104
let env = Safe_typing.push_private_constants (Global.env()) (SideEff.get eff) in
21052105
let fixbodies, fixtypes = List.split proofs in
21062106
let fixrelevances = List.map (EConstr.ERelevance.kind evd) fixrelevances in
21072107
let rec_declaration = prepare_recursive_declaration pinfo.cinfo fixtypes fixrelevances fixbodies in
21082108
let typing_flags = pinfo.info.typing_flags in
2109-
fst (make_recursive_bodies ~sigma:evd env ~typing_flags ~possible_guard ~rec_declaration) in
2109+
let proofs, sigma, _ = (make_recursive_bodies ~sigma:evd env ~typing_flags ~possible_guard ~rec_declaration) in
2110+
proofs, evd
2111+
in
21102112
let proofs = List.map (fun (body, typ) -> (body, Some typ)) proofs in
21112113
let () = if warn_incomplete then check_incomplete_proof evd in
21122114
{ output_entries = proofs; output_ustate = Evd.ustate evd; output_sideff = SideEff.concat eff sideff }

0 commit comments

Comments
 (0)