aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Herbelin2016-07-13 15:27:28 +0200
committerHugo Herbelin2016-07-13 15:31:47 +0200
commit65ba1b36df33a74998240a02fecc1fb80c3eeeee (patch)
treee9af73d9793c275a5fcfe4d10905c60503aa8af4
parent55d32c9a017853c2411f894a3ad1a946c628ba9c (diff)
Fixing printing of evar name in an error message of instantiate.
-rw-r--r--proofs/evar_refiner.ml2
-rw-r--r--test-suite/output/Errors.out2
-rw-r--r--test-suite/output/Errors.v9
3 files changed, 12 insertions, 1 deletions
diff --git a/proofs/evar_refiner.ml b/proofs/evar_refiner.ml
index 059ae54c9d..b6f2f69d29 100644
--- a/proofs/evar_refiner.ml
+++ b/proofs/evar_refiner.ml
@@ -56,7 +56,7 @@ let w_refine (evk,evi) (ltac_var,rawc) sigma =
let loc = Glob_ops.loc_of_glob_constr rawc in
user_err_loc
(loc,"", str "Instance is not well-typed in the environment of " ++
- str (string_of_existential evk))
+ pr_existential_key sigma evk ++ str ".")
in
define_and_solve_constraints evk typed_c env (evars_reset_evd sigma' sigma)
diff --git a/test-suite/output/Errors.out b/test-suite/output/Errors.out
index 6354ad469e..8048deb0c0 100644
--- a/test-suite/output/Errors.out
+++ b/test-suite/output/Errors.out
@@ -5,3 +5,5 @@ Unable to unify "nat" with "True".
The command has indeed failed with message:
In nested Ltac calls to "f" and "apply x", last call failed.
Unable to unify "nat" with "True".
+The command has indeed failed with message:
+Error: Instance is not well-typed in the environment of ?x
diff --git a/test-suite/output/Errors.v b/test-suite/output/Errors.v
index 352c87385f..424d24801c 100644
--- a/test-suite/output/Errors.v
+++ b/test-suite/output/Errors.v
@@ -16,3 +16,12 @@ Goal True.
Fail simpl; apply 0.
Fail simpl; f 0.
Abort.
+
+(* Test instantiate error messages *)
+
+Goal forall T1 (P1 : T1 -> Type), sigT P1 -> sigT P1.
+intros T1 P1 H1.
+eexists ?[x].
+destruct H1 as [x1 H1].
+Fail instantiate (x:=projT1 x1).
+Abort.