From 5eb53b5bc8d765ed75e965f43f1084e18efc8790 Mon Sep 17 00:00:00 2001 From: Hugo Herbelin Date: Sun, 27 Apr 2014 15:09:04 +0200 Subject: 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. --- checker/inductive.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'checker/inductive.ml') diff --git a/checker/inductive.ml b/checker/inductive.ml index 40a9bc316f..e6a24f705d 100644 --- a/checker/inductive.ml +++ b/checker/inductive.ml @@ -352,7 +352,8 @@ let check_case_info env indsp ci = if not (eq_ind indsp ci.ci_ind) || (mib.mind_nparams <> ci.ci_npar) || - (mip.mind_consnrealdecls <> ci.ci_cstr_ndecls) + (mip.mind_consnrealdecls <> ci.ci_cstr_ndecls) || + (mip.mind_consnrealargs <> ci.ci_cstr_nargs) then raise (TypeError(env,WrongCaseInfo(indsp,ci))) (************************************************************************) -- cgit v1.2.3