@@ -3896,24 +3896,25 @@ fold_left over the terms, letin body comes before the type).
38963896 (fun proof _ shelved ~depth proof_context constraints state ->
38973897 let env = proof_context .env in
38983898 let sigma = get_sigma state in
3899- let evars_of_term evd c =
3900- let rec evrec (acc_set ,acc_rev_l as acc ) c =
3901- let c = EConstr. whd_evar evd c in
3899+ let evars_of_term c =
3900+ let rec evrec env (acc_set ,acc_rev_l as acc ) c =
3901+ let c = EConstr. whd_evar sigma c in
39023902 match EConstr. kind sigma c with
39033903 | Constr. Evar (n , l ) ->
3904- if Evar.Set. mem n acc_set then acc
3904+ if Evar.Set. mem n acc_set then
3905+ acc
39053906 else
39063907 let acc = Evar.Set. add n acc_set , n :: acc_rev_l in
3907- SList.Skip. fold evrec acc l
3908+ SList.Skip. fold ( evrec env ) acc l
39083909 | Constr. Proj (_ , _ , c ) ->
39093910 let t = Retyping. get_type_of env sigma c in
3910- let acc = evrec acc t in
3911- evrec acc c
3912- | _ -> EConstr. fold sigma evrec acc c
3911+ let acc = evrec env acc t in
3912+ evrec env acc c
3913+ | _ -> Termops. fold_constr_with_full_binders env sigma EConstr. push_rel evrec env acc c
39133914 in
3914- let _ , rev_l = evrec (Evar.Set. empty , [] ) c in
3915+ let _ , rev_l = evrec env (Evar.Set. empty , [] ) c in
39153916 List. rev rev_l in
3916- let subgoals = evars_of_term sigma proof in
3917+ let subgoals = evars_of_term proof in
39173918 let free_evars =
39183919 let cache = Evarutil. create_undefined_evars_cache () in
39193920 let map ev =
0 commit comments