aboutsummaryrefslogtreecommitdiff
path: root/kernel/typeops.ml
diff options
context:
space:
mode:
authorMatthieu Sozeau2013-10-31 11:56:30 +0100
committerMatthieu Sozeau2014-05-06 09:58:54 +0200
commit05c87ba330a9b4d02b150c196e390b9dd30be341 (patch)
treefc19f68a21198754134aee6fe68a5cb5516b41b7 /kernel/typeops.ml
parent1c1accf7186438228be9c426db9071aa95a7e992 (diff)
Fix interface for template polymorphism, cleaning up code in all typing algorithms.
Diffstat (limited to 'kernel/typeops.ml')
-rw-r--r--kernel/typeops.ml12
1 files changed, 6 insertions, 6 deletions
diff --git a/kernel/typeops.ml b/kernel/typeops.ml
index 9428ace38a..1a7d96b55d 100644
--- a/kernel/typeops.ml
+++ b/kernel/typeops.ml
@@ -158,12 +158,11 @@ let type_of_constant_in env cst =
let ar = constant_type_in env cst in
type_of_constant_type_knowing_parameters env ar [||]
-let judge_of_constant_knowing_parameters env (kn,u as cst) jl =
+let judge_of_constant_knowing_parameters env (kn,u as cst) args =
let c = mkConstU cst in
let cb = lookup_constant kn env in
let _ = check_hyps_inclusion env c cb.const_hyps in
- let paramstyp = Array.map (fun j -> lazy j.uj_type) jl in
- let ty, cu = type_of_constant_knowing_parameters env cst paramstyp in
+ let ty, cu = type_of_constant_knowing_parameters env cst args in
let _ = Environ.check_constraints cu env in
make_judge c ty
@@ -428,13 +427,14 @@ let rec execute env cstr =
let jl = execute_array env args in
let j =
match kind_of_term f with
- | Ind ind ->
+ | Ind ind when Environ.template_polymorphic_ind ind env ->
(* Sort-polymorphism of inductive types *)
let args = Array.map (fun j -> lazy j.uj_type) jl in
judge_of_inductive_knowing_parameters env ind args
- | Const cst ->
+ | Const cst when Environ.template_polymorphic_constant cst env ->
(* Sort-polymorphism of constant *)
- judge_of_constant_knowing_parameters env cst jl
+ let args = Array.map (fun j -> lazy j.uj_type) jl in
+ judge_of_constant_knowing_parameters env cst args
| _ ->
(* No sort-polymorphism *)
execute env f