aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2014-10-20 09:39:28 +0200
committerGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2014-10-20 23:29:19 +0200
commitf00f8482e1d21ef8b03044ed2162cb29d9e4537d (patch)
treeb49c6d121189c442dd73fea08402ee00a269f0cf
parent6e0c5c81e9e81c2e5369427643b2ac51b9aa17e6 (diff)
Fixing a bug in the presence of let-in in inductive arity.
-rw-r--r--pretyping/typing.ml2
-rw-r--r--test-suite/success/Case22.v7
2 files changed, 8 insertions, 1 deletions
diff --git a/pretyping/typing.ml b/pretyping/typing.ml
index eafc5da9a..b1a6e055e 100644
--- a/pretyping/typing.ml
+++ b/pretyping/typing.ml
@@ -111,7 +111,7 @@ let e_type_case_branches env evdref (ind,largs) pj c =
let p = pj.uj_val in
let univ = e_is_correct_arity env evdref c pj ind specif params in
let lc = build_branches_type ind specif params p in
- let n = (snd specif).Declarations.mind_nrealdecls in
+ let n = (snd specif).Declarations.mind_nrealargs in
let ty =
whd_betaiota !evdref (Reduction.betazeta_appvect (n+1) p (Array.of_list (realargs@[c]))) in
(lc, ty, univ)
diff --git a/test-suite/success/Case22.v b/test-suite/success/Case22.v
new file mode 100644
index 000000000..4eb2dbe9f
--- /dev/null
+++ b/test-suite/success/Case22.v
@@ -0,0 +1,7 @@
+(* Check typing in the presence of let-in in inductive arity *)
+
+Inductive I : let a := 1 in a=a -> let b := 2 in Type := C : I (eq_refl).
+Lemma a : forall x:I eq_refl, match x in I a b c return b = b with C => eq_refl end = eq_refl.
+intro.
+match goal with |- ?c => let x := eval cbv in c in change x end.
+Abort.