aboutsummaryrefslogtreecommitdiff
path: root/kernel/typeops.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2021-03-30 14:05:08 +0200
committerPierre-Marie Pédrot2021-03-30 14:05:08 +0200
commit666a3aa8dd7df6dd29ea7944482510048a8a7ba7 (patch)
treebf1558b91b62f14b122aa4fa09d2d56f476b9205 /kernel/typeops.ml
parentf0c6a1de3eef85ab0787be7e87cb8509e8df43d5 (diff)
parent7ff8b12c14867e43d54c3d4c8976a6179250893d (diff)
Merge PR #14005: Support OCaml primitives with an actual arity larger than 4.
Reviewed-by: ppedrot
Diffstat (limited to 'kernel/typeops.ml')
-rw-r--r--kernel/typeops.ml13
1 files changed, 7 insertions, 6 deletions
diff --git a/kernel/typeops.ml b/kernel/typeops.ml
index 741491c917..1b1aa84e6b 100644
--- a/kernel/typeops.ml
+++ b/kernel/typeops.ml
@@ -785,15 +785,16 @@ let type_of_prim env u t =
| PITT_type (ty,t) -> tr_prim_type (tr_type n) ty t
| PITT_param i -> Constr.mkRel (n+i)
in
- let rec nary_op n = function
- | [] -> assert false
- | [ret_ty] -> tr_type n ret_ty
+ let rec nary_op n ret_ty = function
+ | [] -> tr_type n ret_ty
| arg_ty :: r ->
- Constr.mkProd(Context.nameR (Id.of_string "x"), tr_type n arg_ty, nary_op (n+1) r)
+ Constr.mkProd (Context.nameR (Id.of_string "x"),
+ tr_type n arg_ty, nary_op (n + 1) ret_ty r)
in
- let params, sign = types t in
+ let params, args_ty, ret_ty = types t in
assert (AUContext.size (univs t) = Instance.length u);
- Vars.subst_instance_constr u (Term.it_mkProd_or_LetIn (nary_op 0 sign) params)
+ Vars.subst_instance_constr u
+ (Term.it_mkProd_or_LetIn (nary_op 0 ret_ty args_ty) params)
let type_of_prim_or_type env u = let open CPrimitives in
function