From 6ba59cef7e143f1db6e272af165da5334e324e63 Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Mon, 28 May 2018 16:31:24 +0200 Subject: [ssr] rewrite: turn anomaly into regular error I think the bug was introduces when apply_type was made safe. In the test joint to #7255 rewrite (setoid case) generates an ill-typed goal and apply_type raises a Pretype_error. It is unclear to me why the tactic monad does not turn the pretype_error into a UserError --- plugins/ssr/ssrequality.ml | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/ssr/ssrequality.ml b/plugins/ssr/ssrequality.ml index f929e9430..23cbf49c0 100644 --- a/plugins/ssr/ssrequality.ml +++ b/plugins/ssr/ssrequality.ml @@ -417,8 +417,6 @@ let rwcltac cl rdx dir sr gl = then errorstrm Pp.(str "Rewriting impacts evars") else errorstrm Pp.(str "Dependent type error in rewrite of " ++ pr_constr_env (pf_env gl) (project gl) (Term.mkNamedLambda pattern_id (EConstr.Unsafe.to_constr rdxt) (EConstr.Unsafe.to_constr cl))) - | CErrors.UserError _ as e -> raise e - | e -> anomaly ("cvtac's exception: " ^ Printexc.to_string e); in tclTHEN cvtac' rwtac gl -- cgit v1.2.3 From fb825197d08554a208437ee31755a783ce48708b Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Tue, 19 Jun 2018 13:54:05 +0200 Subject: [ssr] test case for rewrite (setoid) making the goal illtyped --- test-suite/ssr/ssr_rew_illtyped.v | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test-suite/ssr/ssr_rew_illtyped.v diff --git a/test-suite/ssr/ssr_rew_illtyped.v b/test-suite/ssr/ssr_rew_illtyped.v new file mode 100644 index 000000000..7358068c8 --- /dev/null +++ b/test-suite/ssr/ssr_rew_illtyped.v @@ -0,0 +1,9 @@ +From Coq Require Import ssreflect Setoid. + +Structure SEProp := {prop_of : Prop; _ : prop_of <-> True}. + +Fact anomaly: forall P : SEProp, prop_of P. +Proof. +move=> [P E]. +Fail rewrite E. +Abort. -- cgit v1.2.3