aboutsummaryrefslogtreecommitdiff
path: root/pretyping
diff options
context:
space:
mode:
authorHugo Herbelin2014-04-27 15:09:04 +0200
committerHugo Herbelin2014-04-28 09:40:46 +0200
commit5eb53b5bc8d765ed75e965f43f1084e18efc8790 (patch)
tree31c87e5f8c9f6cff5f2277912240a2a2f565bc90 /pretyping
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 'pretyping')
-rw-r--r--pretyping/inductiveops.ml1
-rw-r--r--pretyping/term_dnet.ml5
2 files changed, 5 insertions, 1 deletions
diff --git a/pretyping/inductiveops.ml b/pretyping/inductiveops.ml
index 812900ea80..775795ce0d 100644
--- a/pretyping/inductiveops.ml
+++ b/pretyping/inductiveops.ml
@@ -183,6 +183,7 @@ let make_case_info env ind style =
{ ci_ind = ind;
ci_npar = mib.mind_nparams;
ci_cstr_ndecls = mip.mind_consnrealdecls;
+ ci_cstr_nargs = mip.mind_consnrealargs;
ci_pp_info = print_info }
(*s Useful functions *)
diff --git a/pretyping/term_dnet.ml b/pretyping/term_dnet.ml
index d22e032dfa..10ec651fad 100644
--- a/pretyping/term_dnet.ml
+++ b/pretyping/term_dnet.ml
@@ -86,7 +86,10 @@ struct
if c = 0 then
let c = Int.compare ci1.ci_npar ci2.ci_npar in
if c = 0 then
- Array.compare Int.compare ci1.ci_cstr_ndecls ci2.ci_cstr_ndecls
+ let c = Array.compare Int.compare ci1.ci_cstr_ndecls ci2.ci_cstr_ndecls in
+ if c = 0 then
+ Array.compare Int.compare ci1.ci_cstr_nargs ci2.ci_cstr_nargs
+ else c
else c
else c