Bug dans sous-typage entre foncteurs (PR#1780)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5749 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
a03d11709c
commit
705a6371bc
|
@ -147,13 +147,11 @@ and try_modtypes env subst mty1 mty2 =
|
|||
| (Tmty_signature sig1, Tmty_signature sig2) ->
|
||||
signatures env subst sig1 sig2
|
||||
| (Tmty_functor(param1, arg1, res1), Tmty_functor(param2, arg2, res2)) ->
|
||||
let cc_arg =
|
||||
modtypes env Subst.identity (Subst.modtype subst arg2) arg1
|
||||
in
|
||||
let arg2' = Subst.modtype subst arg2 in
|
||||
let cc_arg = modtypes env Subst.identity arg2' arg1 in
|
||||
let cc_res =
|
||||
modtypes (Env.add_module param1 arg2 env)
|
||||
(Subst.add_module param2 (Pident param1) subst) res1 res2
|
||||
in
|
||||
modtypes (Env.add_module param1 arg2' env)
|
||||
(Subst.add_module param2 (Pident param1) subst) res1 res2 in
|
||||
begin match (cc_arg, cc_res) with
|
||||
(Tcoerce_none, Tcoerce_none) -> Tcoerce_none
|
||||
| _ -> Tcoerce_functor(cc_arg, cc_res)
|
||||
|
|
Loading…
Reference in New Issue