aboutsummaryrefslogtreecommitdiffhomepage
path: root/pretyping
diff options
context:
space:
mode:
authorGravatar Matthieu Sozeau <mattam@mattam.org>2014-08-14 14:14:25 +0200
committerGravatar Matthieu Sozeau <mattam@mattam.org>2014-08-14 14:14:25 +0200
commitfcfa1e90df70b7fc00a4865fb48c1dc3250c58d9 (patch)
treeb3111df322b6520937565687b1915d6079127c7f /pretyping
parent37a58edffeff7b6a7f03ec781e1e2ca73de4b3af (diff)
Fix non-printing of coercions for primitive projections (fixes bug #3433).
Diffstat (limited to 'pretyping')
-rw-r--r--pretyping/inductiveops.ml6
-rw-r--r--pretyping/inductiveops.mli4
2 files changed, 10 insertions, 0 deletions
diff --git a/pretyping/inductiveops.ml b/pretyping/inductiveops.ml
index 5e853784e..34243f499 100644
--- a/pretyping/inductiveops.ml
+++ b/pretyping/inductiveops.ml
@@ -264,6 +264,12 @@ let allowed_sorts env (kn,i as ind) =
let (mib,mip) = Inductive.lookup_mind_specif env ind in
mip.mind_kelim
+let projection_nparams_env env p =
+ let pb = lookup_projection p env in
+ pb.proj_npars
+
+let projection_nparams p = projection_nparams_env (Global.env ()) p
+
(* Annotation for cases *)
let make_case_info env ind style =
let (mib,mip) = Inductive.lookup_mind_specif env ind in
diff --git a/pretyping/inductiveops.mli b/pretyping/inductiveops.mli
index 1561cf97b..03d41015b 100644
--- a/pretyping/inductiveops.mli
+++ b/pretyping/inductiveops.mli
@@ -121,6 +121,10 @@ val inductive_has_local_defs : inductive -> bool
val allowed_sorts : env -> inductive -> sorts_family list
+(** Primitive projections *)
+val projection_nparams : projection -> int
+val projection_nparams_env : env -> projection -> int
+
(** Extract information from an inductive family *)
type constructor_summary = {