aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pretyping/inductiveops.ml10
1 files changed, 6 insertions, 4 deletions
diff --git a/pretyping/inductiveops.ml b/pretyping/inductiveops.ml
index 6fa93484f5..07a3378363 100644
--- a/pretyping/inductiveops.ml
+++ b/pretyping/inductiveops.ml
@@ -24,13 +24,15 @@ open Inductive
Inductive, but they expect an env *)
let type_of_inductive env (ind,u) =
- let specif = Inductive.lookup_mind_specif env ind in
- Inductive.type_of_inductive env (specif,u)
+ let (mib,_ as specif) = Inductive.lookup_mind_specif env ind in
+ Typeops.check_hyps_inclusion env (mkInd ind) mib.mind_hyps;
+ Inductive.type_of_inductive env (specif,u)
(* Return type as quoted by the user *)
let type_of_constructor env (cstr,u) =
- let specif =
- Inductive.lookup_mind_specif env (inductive_of_constructor cstr) in
+ let (mib,_ as specif) =
+ Inductive.lookup_mind_specif env (inductive_of_constructor cstr) in
+ Typeops.check_hyps_inclusion env (mkConstruct cstr) mib.mind_hyps;
Inductive.type_of_constructor (cstr,u) specif
let type_of_constructor_in_ctx env cstr =