aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2018-06-23 00:17:21 +0200
committerGravatar Maxime Dénès <mail@maximedenes.fr>2018-06-23 00:17:21 +0200
commitf337d237c97db0b29619e15d21a022bba953a794 (patch)
tree7c041107b934a631d31b6b4e127de8e799188291 /kernel
parentffa99eed82b884645787b7a993017aa4c17010a9 (diff)
parent0daa84151fbd7d6e2646a76b7ff0e6c4fce3bdca (diff)
Merge PR #7715: Simplify the cooking of primitive projections.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cooking.ml19
1 files changed, 9 insertions, 10 deletions
diff --git a/kernel/cooking.ml b/kernel/cooking.ml
index 68057b389..c7a84f617 100644
--- a/kernel/cooking.ml
+++ b/kernel/cooking.ml
@@ -126,16 +126,15 @@ let expmod_constr cache modlist c =
| Not_found -> Constr.map substrec c)
| Proj (p, c') ->
- (try
- let p' = share_univs (ConstRef (Projection.constant p)) Univ.Instance.empty modlist in
- let make c = Projection.make c (Projection.unfolded p) in
- match kind p' with
- | Const (p',_) -> mkProj (make p', substrec c')
- | App (f, args) ->
- (match kind f with
- | Const (p', _) -> mkProj (make p', substrec c')
- | _ -> assert false)
- | _ -> assert false
+ (try
+ (** No need to expand parameters or universes for projections *)
+ let map cst =
+ let _ = Cmap.find cst (fst modlist) in
+ pop_con cst
+ in
+ let p = Projection.map map p in
+ let c' = substrec c' in
+ mkProj (p, c')
with Not_found -> Constr.map substrec c)
| _ -> Constr.map substrec c