summaryrefslogtreecommitdiff
path: root/kernel/modops.ml
diff options
context:
space:
mode:
authorGravatar Samuel Mimram <smimram@debian.org>2007-08-18 20:34:57 +0000
committerGravatar Samuel Mimram <smimram@debian.org>2007-08-18 20:34:57 +0000
commit72b9a7df489ea47b3e5470741fd39f6100d31676 (patch)
tree60108a573d2a80d2dd4e3833649890e32427ff8d /kernel/modops.ml
parent55ce117e8083477593cf1ff2e51a3641c7973830 (diff)
Imported Upstream version 8.1.pl1+dfsgupstream/8.1.pl1+dfsg
Diffstat (limited to 'kernel/modops.ml')
-rw-r--r--kernel/modops.ml24
1 files changed, 13 insertions, 11 deletions
diff --git a/kernel/modops.ml b/kernel/modops.ml
index 8bab3c9d..fb00cfcd 100644
--- a/kernel/modops.ml
+++ b/kernel/modops.ml
@@ -6,7 +6,7 @@
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-(*i $Id: modops.ml 9558 2007-01-30 14:58:42Z soubiran $ i*)
+(*i $Id: modops.ml 9980 2007-07-12 13:32:37Z soubiran $ i*)
(*i*)
open Util
@@ -33,10 +33,11 @@ let error_not_a_functor _ = error "Application of not a functor"
let error_incompatible_modtypes _ _ = error "Incompatible module types"
-let error_not_equal _ _ = error "Not equal modules"
-
-let error_not_match l _ = error ("Signature components for label "^string_of_label l^" do not match")
+let error_not_equal p1 p2 = error ((string_of_mp p1)^" and "^(string_of_mp p2)^" are not equal modules")
+let error_not_match l l1 l2 = error (l1^" is not a subtype of "^l2^": "^
+ "Signature components for label "^(string_of_label l)^" do not match.")
+
let error_no_such_label l = error ("No such label "^string_of_label l)
let error_incompatible_labels l l' =
@@ -89,7 +90,7 @@ let error_circularity_in_subtyping l l1 l2 =
error ("An occurrence of "^l^" creates a circularity\n during the subtyping verification between "^l1^" and "^l2^".")
let error_no_such_label_sub l l1 l2 =
- error (l1^" is not a subtype of "^l2^".\nThe field "^(string_of_label l)^" is missing (or invisible) in "^l1^".")
+ error (l1^" is not a subtype of "^l2^":"^"The field "^(string_of_label l)^" is missing in "^l1^".")
let rec scrape_modtype env = function
@@ -124,6 +125,7 @@ let destr_functor = function
| MTBfunsig (arg_id,arg_t,body_t) -> (arg_id,arg_t,body_t)
| mtb -> error_not_a_functor mtb
+exception Not_equiv_path
let rec check_modpath_equiv env mp1 mp2 =
if mp1=mp2 then () else
@@ -132,7 +134,7 @@ let rec check_modpath_equiv env mp1 mp2 =
| None ->
let mb2 = lookup_module mp2 env in
(match mb2.mod_equiv with
- | None -> error_not_equal mp1 mp2
+ | None -> raise Not_equiv_path
| Some mp2' -> check_modpath_equiv env mp2' mp1)
| Some mp1' -> check_modpath_equiv env mp2 mp1'
@@ -244,16 +246,16 @@ and constants_of_modtype env mp modtype =
| MTBfunsig _ -> []
(* returns a resolver for kn that maps mbid to mp *)
-(* Nota: Some delta-expansions used to happen here.
- Browse SVN if you want to know more. *)
+(* Desactivated until v8.2, waiting for the integration
+of "Parameter Inline". *)
let resolver_of_environment mbid modtype mp env =
let constants = constants_of_modtype env (MPbound mbid) modtype in
- let resolve = List.map (fun (con,_) -> con,None) constants in
- Mod_subst.make_resolver resolve
+ let _ = List.map (fun (con,_) -> con,None) constants in
+ Mod_subst.make_resolver []
let strengthen_const env mp l cb =
- match cb.const_opaque, cb.const_body with
+ match cb.const_opaque, cb.const_body with
| false, Some _ -> cb
| true, Some _
| _, None ->