Skip to content

Commit

Permalink
fix PR#5124
Browse files Browse the repository at this point in the history
git-svn-id: http://caml.inria.fr/svn/ocaml/version/3.12@10650 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
garrigue committed Aug 19, 2010
1 parent dd19195 commit 9264f71
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
7 changes: 6 additions & 1 deletion testlabl/sigsubst.ml
Expand Up @@ -6,15 +6,20 @@ module type Comparable = sig
type t
val compare : t -> t -> int
end
module type PrintableComparable = sig
include Printable
include Comparable with type t = t
end
module type PrintableComparable = sig
type t
include Printable with type t := t
include Comparable with type t := t
end
module type PrintableComparable2 = sig
module type PrintableComparable = sig
include Printable
include Comparable with type t := t
end
module type ComparableInt = Comparable with type t := int

module type S = sig type t val f : t -> t end
module type S' = S with type t := int
Expand Down
14 changes: 12 additions & 2 deletions typing/typemod.ml
Expand Up @@ -91,6 +91,16 @@ let rec make_params n = function

let wrap_param s = {ptyp_desc=Ptyp_var s; ptyp_loc=Location.none}

let make_next_first rs rem =
if rs = Trec_first then
match rem with
Tsig_type (id, decl, Trec_next) :: rem ->
Tsig_type (id, decl, Trec_first) :: rem
| Tsig_module (id, mty, Trec_next) :: rem ->
Tsig_module (id, mty, Trec_first) :: rem
| _ -> rem
else rem

let merge_constraint initial_env loc sg lid constr =
let real_id = ref None in
let rec merge env sg namelist row_id =
Expand Down Expand Up @@ -134,7 +144,7 @@ let merge_constraint initial_env loc sg lid constr =
Typedecl.transl_with_constraint initial_env id None sdecl in
check_type_decl env id row_id newdecl decl rs rem;
real_id := Some id;
rem
make_next_first rs rem
| (Tsig_module(id, mty, rs) :: rem, [s], Pwith_module lid)
when Ident.name id = s ->
let (path, mty') = Typetexp.find_module initial_env loc lid in
Expand All @@ -147,7 +157,7 @@ let merge_constraint initial_env loc sg lid constr =
let newmty = Mtype.strengthen env mty' path in
ignore(Includemod.modtypes env newmty mty);
real_id := Some id;
rem
make_next_first rs rem
| (Tsig_module(id, mty, rs) :: rem, s :: namelist, _)
when Ident.name id = s ->
let newsg = merge env (extract_sig env loc mty) namelist None in
Expand Down

0 comments on commit 9264f71

Please sign in to comment.