aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/sphinx/proof-engine/tactics.rst2
-rw-r--r--tactics/tactics.ml3
2 files changed, 3 insertions, 2 deletions
diff --git a/doc/sphinx/proof-engine/tactics.rst b/doc/sphinx/proof-engine/tactics.rst
index 306673d9a2..e6bc84365c 100644
--- a/doc/sphinx/proof-engine/tactics.rst
+++ b/doc/sphinx/proof-engine/tactics.rst
@@ -3979,7 +3979,7 @@ succeeds, and results in an error otherwise.
This tactic checks whether its arguments are unifiable, potentially
instantiating existential variables.
-.. exn:: Not unifiable.
+.. exn:: Unable to unify @term with @term.
.. tacv:: unify @term @term with @ident
diff --git a/tactics/tactics.ml b/tactics/tactics.ml
index 5fc34619e8..2a8ebe08ca 100644
--- a/tactics/tactics.ml
+++ b/tactics/tactics.ml
@@ -5063,6 +5063,7 @@ let constr_eq ~strict x y =
let unify ?(state=full_transparent_state) x y =
Proofview.Goal.enter begin fun gl ->
+ let env = Proofview.Goal.env gl in
let sigma = Proofview.Goal.sigma gl in
try
let core_flags =
@@ -5078,7 +5079,7 @@ let unify ?(state=full_transparent_state) x y =
let sigma = w_unify (Tacmach.New.pf_env gl) sigma Reduction.CONV ~flags x y in
Proofview.Unsafe.tclEVARS sigma
with e when CErrors.noncritical e ->
- Tacticals.New.tclFAIL 0 (str"Not unifiable")
+ Proofview.tclZERO (PretypeError (env, sigma, CannotUnify (x, y, None)))
end
module Simple = struct