Ajout alpha-conversion manquante dans la construction 'SIG with ...' (PR#1968)

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6116 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Leroy 2004-02-14 17:38:02 +00:00
parent facf2ed9fa
commit 29791fc19f
3 changed files with 7 additions and 1 deletions

View File

@ -28,6 +28,9 @@ let rec scrape env mty =
end
| _ -> mty
let freshen mty =
Subst.modtype Subst.identity mty
let rec strengthen env mty p =
match scrape env mty with
Tmty_signature sg ->

View File

@ -20,6 +20,9 @@ val scrape: Env.t -> module_type -> module_type
(* Expand toplevel module type abbreviations
till hitting a "hard" module type (signature, functor,
or abstract module type ident. *)
val freshen: module_type -> module_type
(* Return an alpha-equivalent copy of the given module type
where bound identifiers are fresh. *)
val strengthen: Env.t -> module_type -> Path.t -> module_type
(* Strengthen abstract type components relative to the
given path. *)

View File

@ -237,7 +237,7 @@ let rec transl_modtype env smty =
(fun sg (lid, sdecl) ->
merge_constraint env smty.pmty_loc sg lid sdecl)
init_sg constraints in
Tmty_signature final_sg
Mtype.freshen (Tmty_signature final_sg)
and transl_signature env sg =
let type_names = ref StringSet.empty