From 2727af30f9338830c2b225587f87ed8a4e80f7e3 Mon Sep 17 00:00:00 2001 From: Gaƫtan Gilbert Date: Fri, 19 Jul 2019 12:59:13 +0200 Subject: Fix #10533: uncaught Invalid_argument Array.fold_left2 in rewrite --- pretyping/unification.ml | 5 +++-- test-suite/bugs/closed/bug_10533.v | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 test-suite/bugs/closed/bug_10533.v diff --git a/pretyping/unification.ml b/pretyping/unification.ml index 00831b5962..a9eb43e573 100644 --- a/pretyping/unification.ml +++ b/pretyping/unification.ml @@ -839,8 +839,9 @@ let rec unify_0_with_initial_metas (sigma,ms,es as subst : subst0) conv_at_top e unify_app_pattern true curenvnb pb opt substn cM f1 l1 cN f2 l2 | _ -> raise ex) - | Case (_,p1,c1,cl1), Case (_,p2,c2,cl2) -> - (try + | Case (ci1,p1,c1,cl1), Case (ci2,p2,c2,cl2) -> + (try + if not (eq_ind ci1.ci_ind ci2.ci_ind) then error_cannot_unify curenv sigma (cM,cN); let opt' = {opt with at_top = true; with_types = false} in Array.fold_left2 (unirec_rec curenvnb CONV {opt with at_top = true}) (unirec_rec curenvnb CONV opt' diff --git a/test-suite/bugs/closed/bug_10533.v b/test-suite/bugs/closed/bug_10533.v new file mode 100644 index 0000000000..e72957bdee --- /dev/null +++ b/test-suite/bugs/closed/bug_10533.v @@ -0,0 +1,8 @@ + +Require Import Eqdep Setoid. +Goal forall (t : unit) (pf : tt = t), + if (match pf with eq_refl => false end) then True else False. +Proof. + intros. + try setoid_rewrite <-Eqdep.Eq_rect_eq.eq_rect_eq. +Abort. -- cgit v1.2.3