summaryrefslogtreecommitdiff
path: root/toplevel/class.ml
diff options
context:
space:
mode:
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