summaryrefslogtreecommitdiff
path: root/typing
diff options
context:
space:
mode:
authorJérôme Vouillon <Jerome.Vouillon@pps.jussieu.fr>1997-03-12 10:26:58 +0000
committerJérôme Vouillon <Jerome.Vouillon@pps.jussieu.fr>1997-03-12 10:26:58 +0000
commit79240af6cc14f61b84dc77d3fff602ddc17b975f (patch)
tree5236fb199c5efe7a9830b9f227862c884feab586 /typing
parent91a174ecf94dd0344e9a6ee335230a2dcb203272 (diff)
downloadocaml-79240af6cc14f61b84dc77d3fff602ddc17b975f.tar.gz
La substitution n'etait pas appliquee dans certains cas...
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@1373 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'typing')
-rw-r--r--typing/includemod.ml16
1 files changed, 12 insertions, 4 deletions
diff --git a/typing/includemod.ml b/typing/includemod.ml
index b969ffc0aa..ec73d04db4 100644
--- a/typing/includemod.ml
+++ b/typing/includemod.ml
@@ -128,12 +128,10 @@ let rec modtypes env subst mty1 mty2 =
and try_modtypes env subst mty1 mty2 =
match (mty1, mty2) with
- (Tmty_ident p1, Tmty_ident p2) when Path.same p1 p2 ->
- Tcoerce_none
+ (_, Tmty_ident p2) ->
+ try_modtypes2 env mty1 (Subst.modtype subst mty2)
| (Tmty_ident p1, _) ->
try_modtypes env subst (expand_module_path env p1) mty2
- | (_, Tmty_ident p2) ->
- try_modtypes env subst mty1 (expand_module_path env p2)
| (Tmty_signature sig1, Tmty_signature sig2) ->
signatures env subst sig1 sig2
| (Tmty_functor(param1, arg1, res1), Tmty_functor(param2, arg2, res2)) ->
@@ -151,6 +149,16 @@ and try_modtypes env subst mty1 mty2 =
| (_, _) ->
raise Dont_match
+and try_modtypes2 env mty1 mty2 =
+ (* mty2 is an identifier *)
+ match (mty1, mty2) with
+ (Tmty_ident p1, Tmty_ident p2) when Path.same p1 p2 ->
+ Tcoerce_none
+ | (_, Tmty_ident p2) ->
+ try_modtypes env Subst.identity mty1 (expand_module_path env p2)
+ | (_, _) ->
+ fatal_error "Includemod.try_modtypes2"
+
(* Inclusion between signatures *)
and signatures env subst sig1 sig2 =