summaryrefslogtreecommitdiff
path: root/toplevel/class.ml
diff options
context:
space:
mode:
authorGravatar Samuel Mimram <samuel.mimram@ens-lyon.org>2005-01-31 14:34:14 +0000
committerGravatar Samuel Mimram <samuel.mimram@ens-lyon.org>2005-01-31 14:34:14 +0000
commite669490d0d5e6ed4bb45c895194791f01d038637 (patch)
tree4eb40b447e6573dbaa1cf593a2cae6758850cb7c /toplevel/class.ml
parentd334716fb2d09dd3304f98ee0dbf39275eac010b (diff)
parent6497f27021fec4e01f2182014f2bb1989b4707f9 (diff)
Merge commit 'upstream/8.0pl2'
Diffstat (limited to 'toplevel/class.ml')
-rw-r--r--toplevel/class.ml12
1 files changed, 5 insertions, 7 deletions
diff --git a/toplevel/class.ml b/toplevel/class.ml
index 429469b1..f5493929 100644
--- a/toplevel/class.ml
+++ b/toplevel/class.ml
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-(* $Id: class.ml,v 1.44.2.2 2004/07/16 19:31:47 herbelin Exp $ *)
+(* $Id: class.ml,v 1.44.2.3 2004/11/26 18:06:54 herbelin Exp $ *)
open Util
open Pp
@@ -92,15 +92,13 @@ let explain_coercion_error g = function
(* Verifications pour l'ajout d'une classe *)
-let rec arity_sort a = match kind_of_term a with
- | Sort (Prop _ | Type _) -> 0
- | Prod (_,_,c) -> (arity_sort c) +1
- | LetIn (_,_,_,c) -> arity_sort c (* Utile ?? *)
- | Cast (c,_) -> arity_sort c
+let rec arity_sort (ctx,a) = match kind_of_term a with
+ | Sort (Prop _ | Type _) -> List.length ctx
| _ -> raise Not_found
let check_reference_arity ref =
- try arity_sort (Global.type_of_global ref)
+ let t = Global.type_of_global ref in
+ try arity_sort (Reductionops.splay_prod (Global.env()) Evd.empty t)
with Not_found -> raise (CoercionError (NotAClass ref))
let check_arity = function