diff options
-rw-r--r-- | pretyping/typing.ml | 2 | ||||
-rw-r--r-- | test-suite/success/Case22.v | 7 |
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. |