aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2018-02-21 18:54:13 +0100
committerGravatar Maxime Dénès <mail@maximedenes.fr>2018-02-21 18:54:13 +0100
commit8669a9449a11cc2e5ddeeba5b0ddc44c7a978d44 (patch)
tree915abd085649c6486017f030aee7e23f9d2c59af
parent6ee9f47718fa9929de4d8e724d9df6d389ea9dc8 (diff)
parentee31c1d24e0c493bb777a58d871f5085222fbc4d (diff)
Merge PR #6748: Fix bug #6529: nf_evar_info to nf the evars' env not just the concl
-rw-r--r--test-suite/bugs/closed/6529.v16
-rw-r--r--vernac/vernacentries.ml8
2 files changed, 21 insertions, 3 deletions
diff --git a/test-suite/bugs/closed/6529.v b/test-suite/bugs/closed/6529.v
new file mode 100644
index 000000000..8d9081999
--- /dev/null
+++ b/test-suite/bugs/closed/6529.v
@@ -0,0 +1,16 @@
+Require Import Vector Program.
+
+Program Definition append_nil_def :=
+ forall A n (ls: t A n), append ls (nil A) = ls. (* Works *)
+
+Lemma append_nil : append_nil_def. (* Works *)
+Proof.
+Admitted.
+
+Program Lemma append_nil' :
+ forall A n (ls: t A n), append ls (nil A) = ls.
+Abort.
+
+Fail Program Lemma append_nil'' :
+ forall A B n (ls: t A n), append ls (nil A) = ls.
+(* Error: Anomaly "Evar ?X25 was not declared." Please report at http://coq.inria.fr/bugs/. *)
diff --git a/vernac/vernacentries.ml b/vernac/vernacentries.ml
index 35ef4bfa4..fa457c895 100644
--- a/vernac/vernacentries.ml
+++ b/vernac/vernacentries.ml
@@ -443,11 +443,13 @@ let start_proof_and_print k l hook =
let hook env sigma ev =
let tac = !Obligations.default_tactic in
let evi = Evd.find sigma ev in
+ let evi = Evarutil.nf_evar_info sigma evi in
let env = Evd.evar_filtered_env evi in
try
- let concl = Evarutil.nf_evars_universes sigma evi.Evd.evar_concl in
- let concl = EConstr.of_constr concl in
- if Evarutil.has_undefined_evars sigma concl then raise Exit;
+ let concl = EConstr.of_constr evi.Evd.evar_concl in
+ if not (Evarutil.is_ground_env sigma env &&
+ Evarutil.is_ground_term sigma concl)
+ then raise Exit;
let c, _, ctx =
Pfedit.build_by_tactic env (Evd.evar_universe_context sigma)
concl (Tacticals.New.tclCOMPLETE tac)