aboutsummaryrefslogtreecommitdiff
path: root/kernel/inductive.ml
diff options
context:
space:
mode:
authorHugo Herbelin2014-04-27 15:09:04 +0200
committerHugo Herbelin2014-04-28 09:40:46 +0200
commit5eb53b5bc8d765ed75e965f43f1084e18efc8790 (patch)
tree31c87e5f8c9f6cff5f2277912240a2a2f565bc90 /kernel/inductive.ml
parent6541e32be7018104c47ccad75ff41ffc750ff944 (diff)
Adding a field ci_cstr_nargs to case_info and mind_consnrealargs to
one_inductive_body so that when eta-expanding at "match" printing time we know if a let is part of the expected signature or part of the body. This is an easy fix for bugs like #3293. Another fix could be to enforce, as an invariant, or better syntactically, that "match"/"Case"'s have the body of their branches expanded.
Diffstat (limited to 'kernel/inductive.ml')
-rw-r--r--kernel/inductive.ml3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/inductive.ml b/kernel/inductive.ml
index c0857566df..2b2caaf3bf 100644
--- a/kernel/inductive.ml
+++ b/kernel/inductive.ml
@@ -370,7 +370,8 @@ let check_case_info env indsp ci =
if
not (eq_ind indsp ci.ci_ind) ||
not (Int.equal mib.mind_nparams ci.ci_npar) ||
- not (Array.equal Int.equal mip.mind_consnrealdecls ci.ci_cstr_ndecls)
+ not (Array.equal Int.equal mip.mind_consnrealdecls ci.ci_cstr_ndecls) ||
+ not (Array.equal Int.equal mip.mind_consnrealargs ci.ci_cstr_nargs)
then raise (TypeError(env,WrongCaseInfo(indsp,ci)))
(************************************************************************)