From b741f0e153f8e647d68ab0ab37a146d8d1518ae1 Mon Sep 17 00:00:00 2001 From: Alain Frisch Date: Jul 08 2014 13:09:39 +0000 Subject: Keep attributes and location on recursive modules when inserted in the environment. git-svn-id: http://caml.inria.fr/svn/ocaml/version/4.02@14996 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- diff --git a/typing/typemod.ml b/typing/typemod.ml index 3cb7193..f07fc60 100644 --- a/typing/typemod.ml +++ b/typing/typemod.ml @@ -1303,7 +1303,16 @@ and type_structure ?(toplevel = false) funct_body anchor env sstr scope = decls sbind in let newenv = (* allow aliasing recursive modules from outside *) List.fold_left - (fun env md -> Env.add_module md.md_id md.md_type.mty_type env) + (fun env md -> + let mdecl = + { + md_type = md.md_type.mty_type; + md_attributes = md.md_attributes; + md_loc = md.md_loc; + } + in + Env.add_module_declaration md.md_id mdecl env + ) env decls in let bindings2 =