@@ -662,11 +662,11 @@ and cltype_data =
662662and short_paths_addition =
663663 | Type of Ident. t * type_declaration
664664 | Class_type of Ident. t * class_type_declaration
665- | Module_type of Ident. t * modtype_declaration
666- | Module of Ident. t * module_declaration * module_components
665+ | Module_type of Ident. t * Subst.Lazy. modtype_declaration
666+ | Module of Ident. t * Subst.Lazy. module_decl * module_components
667667 | Type_open of Path. t * type_data NameMap. t
668668 | Class_type_open of Path. t * class_type_declaration NameMap. t
669- | Module_type_open of Path. t * modtype_declaration NameMap. t
669+ | Module_type_open of Path. t * Subst.Lazy. modtype_declaration NameMap. t
670670 | Module_open of Path. t * module_data NameMap. t
671671
672672let empty_structure =
@@ -1771,20 +1771,15 @@ let short_paths_class_type_open path decls old =
17711771 else Class_type_open (path, decls) :: old
17721772
17731773let short_paths_module_type id decl old =
1774- let decl = Subst.Lazy. force_modtype_decl decl in
17751774 if ! Clflags. real_paths then old
17761775 else Module_type (id, decl) :: old
17771776
17781777let short_paths_module_type_open path decls old =
1779- let decls = NameMap. map
1780- (fun mtda -> Subst.Lazy. force_modtype_decl mtda.mtda_declaration)
1781- decls
1782- in
1778+ let decls = NameMap. map (fun mtda -> mtda.mtda_declaration) decls in
17831779 if ! Clflags. real_paths then old
17841780 else Module_type_open (path, decls) :: old
17851781
17861782let short_paths_module id decl comps old =
1787- let decl = Subst.Lazy. force_module_decl decl in
17881783 if ! Clflags. real_paths then old
17891784 else Module (id, decl, comps) :: old
17901785
@@ -4036,13 +4031,13 @@ let short_paths_class_type_desc clty =
40364031 | ns -> Subst (path, ns)
40374032 end
40384033
4039- let short_paths_module_type_desc mty =
4034+ let short_paths_module_type_desc ( mty : Subst.Lazy.modtype option ) =
40404035 let open Short_paths.Desc.Module_type in
40414036 match mty with
4042- | None | Some Mty_for_hole -> Fresh
4043- | Some (Mty_ident path ) -> Alias path
4044- | Some (Mty_signature _ | Mty_functor _ ) -> Fresh
4045- | Some (Mty_alias _ ) -> assert false
4037+ | None | Some MtyL_for_hole -> Fresh
4038+ | Some (MtyL_ident path ) -> Alias path
4039+ | Some (MtyL_signature _ | MtyL_functor _ ) -> Fresh
4040+ | Some (MtyL_alias _ ) -> assert false
40464041
40474042let deprecated_of_alerts alerts =
40484043 if
@@ -4059,26 +4054,26 @@ let deprecated_of_alerts alerts =
40594054let deprecated_of_attributes attrs =
40604055 deprecated_of_alerts (Builtin_attributes. alerts_of_attrs attrs)
40614056
4062- let rec short_paths_module_desc env mpath mty comp =
4057+ let rec short_paths_module_desc env mpath ( mty : Subst.Lazy.modtype ) comp =
40634058 let open Short_paths.Desc.Module in
40644059 match mty with
4065- | Mty_alias path -> Alias path
4066- | Mty_ident path -> begin
4067- match find_modtype_expansion path env with
4060+ | MtyL_alias path -> Alias path
4061+ | MtyL_ident path -> begin
4062+ match find_modtype_expansion_lazy path env with
40684063 | exception Not_found -> Fresh (Signature (lazy [] ))
40694064 | mty -> short_paths_module_desc env mpath mty comp
40704065 end
4071- | Mty_signature _ ->
4066+ | MtyL_signature _ ->
40724067 let components =
40734068 lazy (short_paths_module_components_desc env mpath comp)
40744069 in
40754070 Fresh (Signature components)
4076- | Mty_functor _ ->
4071+ | MtyL_functor _ ->
40774072 let apply path =
40784073 short_paths_functor_components_desc env mpath comp path
40794074 in
40804075 Fresh (Functor apply)
4081- | Mty_for_hole -> Fresh (Signature (lazy [] ))
4076+ | MtyL_for_hole -> Fresh (Signature (lazy [] ))
40824077
40834078and short_paths_module_components_desc env mpath comp =
40844079 match get_components comp with
@@ -4103,19 +4098,17 @@ and short_paths_module_components_desc env mpath comp =
41034098 in
41044099 let comps =
41054100 String.Map. fold (fun name mtda acc ->
4106- let mtd = Subst.Lazy. force_modtype_decl mtda.mtda_declaration in
4107- let desc = short_paths_module_type_desc mtd.mtd_type in
4108- let depr = deprecated_of_attributes mtd.mtd_attributes in
4101+ let desc = short_paths_module_type_desc mtda.mtda_declaration.mtdl_type in
4102+ let depr = deprecated_of_attributes mtda.mtda_declaration.mtdl_attributes in
41094103 let item = Short_paths.Desc.Module. Module_type (name, desc, depr) in
41104104 item :: acc
41114105 ) c.comp_modtypes comps
41124106 in
41134107 let comps =
41144108 String.Map. fold (fun name { mda_declaration; mda_components; _ } acc ->
4115- let mty = Subst.Lazy. force_module_decl mda_declaration in
41164109 let mpath = Pdot (mpath, name) in
41174110 let desc =
4118- short_paths_module_desc env mpath mty.md_type mda_components
4111+ short_paths_module_desc env mpath mda_declaration.mdl_type mda_components
41194112 in
41204113 let depr = deprecated_of_alerts mda_components.alerts in
41214114 let item = Short_paths.Desc.Module. Module (name, desc, depr) in
@@ -4145,6 +4138,7 @@ and short_paths_functor_components_desc env mpath comp path =
41454138 stamped_path_add f.fcomp_subst_cache path mty;
41464139 mty
41474140 in
4141+ let mty = Subst.Lazy. of_modtype mty in
41484142 let loc = Location. (in_file ! input_name) in
41494143 let comps =
41504144 components_of_functor_appl ~loc ~f_comp: f env ~f_path: mpath ~arg: path
@@ -4167,14 +4161,12 @@ let short_paths_additions_desc env additions =
41674161 let depr = deprecated_of_attributes clty.clty_attributes in
41684162 Short_paths.Desc. Class_type (id, desc, source, depr) :: acc
41694163 | Module_type (id , mtd ) ->
4170- let desc = short_paths_module_type_desc mtd.mtd_type in
4164+ let desc = short_paths_module_type_desc mtd.mtdl_type in
41714165 let source = Short_paths.Desc. Local in
4172- let depr = deprecated_of_attributes mtd.mtd_attributes in
4166+ let depr = deprecated_of_attributes mtd.mtdl_attributes in
41734167 Short_paths.Desc. Module_type (id, desc, source, depr) :: acc
41744168 | Module (id , md , comps ) ->
4175- let desc =
4176- short_paths_module_desc env (Pident id) md.md_type comps
4177- in
4169+ let desc = short_paths_module_desc env (Pident id) md.mdl_type comps in
41784170 let source = Short_paths.Desc. Local in
41794171 let depr = deprecated_of_alerts comps.alerts in
41804172 Short_paths.Desc. Module (id, desc, source, depr) :: acc
@@ -4200,12 +4192,12 @@ let short_paths_additions_desc env additions =
42004192 decls acc
42014193 | Module_type_open (root , decls ) ->
42024194 String.Map. fold
4203- (fun name mtd acc ->
4195+ (fun name ( mtd : Subst.Lazy.modtype_declaration ) acc ->
42044196 let id = Ident. create_local name in
42054197 let path = Pdot (root, name) in
42064198 let desc = Short_paths.Desc.Module_type. Alias path in
42074199 let source = Short_paths.Desc. Open in
4208- let depr = deprecated_of_attributes mtd.mtd_attributes in
4200+ let depr = deprecated_of_attributes mtd.mtdl_attributes in
42094201 Short_paths.Desc. Module_type (id, desc, source, depr) :: acc)
42104202 decls acc
42114203 | Module_open (root , decls ) ->
0 commit comments