diff options
author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2013-11-11 05:00:10 +0000 |
---|---|---|
committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2013-11-11 05:00:10 +0000 |
commit | 5d379f7706d5039150d45b83a34ac3c97d68d532 (patch) | |
tree | 1c366fa753e56504a7ccca35513586d71fc9552a /typing/env.ml | |
parent | 00fa4010df1c981bc5cabe0f82aa8dab79978a2d (diff) |
use new scrape_alias for Env too
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/module-alias@14281 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'typing/env.ml')
-rw-r--r-- | typing/env.ml | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/typing/env.ml b/typing/env.ml index 5f1d8141f..cd98b3104 100644 --- a/typing/env.ml +++ b/typing/env.ml @@ -266,6 +266,10 @@ let check_modtype_inclusion = (* to be filled with Includemod.check_modtype_inclusion *) ref ((fun env mty1 path1 mty2 -> assert false) : t -> module_type -> Path.t -> module_type -> unit) +let strengthen = + (* to be filled with Mtype.strengthen *) + ref ((fun env mty path -> assert false) : + t -> module_type -> Path.t -> module_type) let md md_type = {md_type; md_attributes=[]} @@ -972,25 +976,29 @@ let add_gadt_instance_chain env lv t = (* Expand manifest module type names at the top of the given module type *) -let rec scrape_alias env mty = - match mty with - Mty_ident path -> +let rec scrape_alias env ?path mty = + match mty, path with + Mty_ident path, _ -> begin try scrape_alias env (find_modtype_expansion path env) with Not_found -> mty end - | Mty_alias path -> + | Mty_alias path, _ -> begin try - scrape_alias env (find_module path env).md_type + scrape_alias env (find_module path env).md_type ~path with Not_found -> Location.prerr_warning Location.none (Warnings.Deprecated ("module " ^ Path.name path ^ " cannot be accessed")); mty end + | mty, Some path -> + !strengthen env mty path | _ -> mty +let scrape_alias env mty = scrape_alias env mty + (* Compute constructor descriptions *) let constructors_of_type ty_path decl = |