From 0a00445b113d61a82613f1ba641454b76bd6387c Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Mon, 16 Jul 2018 14:07:01 +0200 Subject: Fix #7291: unify tactic should have more descriptive error messages. We simply reuse the same exception as the pretyper instead of raising the generic failure exception in Tactics.unify. --- tactics/tactics.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tactics/tactics.ml b/tactics/tactics.ml index 928530744a..3a09a0e00e 100644 --- a/tactics/tactics.ml +++ b/tactics/tactics.ml @@ -5062,6 +5062,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 = @@ -5077,7 +5078,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 -- cgit v1.2.3 From ec0e4eb918fc6d95abd5f92b9bea0464662e7245 Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Tue, 24 Jul 2018 11:07:04 +0200 Subject: Update the documentation w.r.t. the new error raised by unify. --- doc/sphinx/proof-engine/tactics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/sphinx/proof-engine/tactics.rst b/doc/sphinx/proof-engine/tactics.rst index ec085a71e5..89668a2d7e 100644 --- a/doc/sphinx/proof-engine/tactics.rst +++ b/doc/sphinx/proof-engine/tactics.rst @@ -3976,7 +3976,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 -- cgit v1.2.3