aboutsummaryrefslogtreecommitdiffhomepage
path: root/vernac/class.ml
diff options
context:
space:
mode:
authorGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2017-07-12 15:55:51 +0200
committerGravatar Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr>2017-07-13 15:14:45 +0200
commit469a9b3242891b089b4a211e96b5b568277f7fc0 (patch)
treebd6854ea387f33192bf3d44c6d729e5d23471f49 /vernac/class.ml
parent34bcd562cc9c8e5e6b0f3b79a15b9c55dd98813e (diff)
Remove the function Global.type_of_global_unsafe.
Diffstat (limited to 'vernac/class.ml')
-rw-r--r--vernac/class.ml6
1 files changed, 4 insertions, 2 deletions
diff --git a/vernac/class.ml b/vernac/class.ml
index 0b510bbcf..be682977e 100644
--- a/vernac/class.ml
+++ b/vernac/class.ml
@@ -62,7 +62,9 @@ let explain_coercion_error g = function
(* Verifications pour l'ajout d'une classe *)
let check_reference_arity ref =
- if not (Reductionops.is_arity (Global.env()) Evd.empty (EConstr.of_constr (Global.type_of_global_unsafe ref))) (** FIXME *) then
+ let env = Global.env () in
+ let c, _ = Global.type_of_global_in_context env ref in
+ if not (Reductionops.is_arity env Evd.empty (EConstr.of_constr c)) (** FIXME *) then
raise (CoercionError (NotAClass ref))
let check_arity = function
@@ -252,7 +254,7 @@ let warn_uniform_inheritance =
let add_new_coercion_core coef stre poly source target isid =
check_source source;
- let t = Global.type_of_global_unsafe coef in
+ let t, _ = Global.type_of_global_in_context (Global.env ()) coef in
if coercion_exists coef then raise (CoercionError AlreadyExists);
let tg,lp = prods_of t in
let llp = List.length lp in