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(-) (limited to 'tactics') 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