@@ -830,11 +830,11 @@ and cltype_data =
830830and short_paths_addition =
831831 | Type of Ident. t * type_declaration
832832 | Class_type of Ident. t * class_type_declaration
833- | Module_type of Ident. t * modtype_declaration
834- | Module of Ident. t * module_declaration * module_components
833+ | Module_type of Ident. t * Subst.Lazy. modtype_declaration
834+ | Module of Ident. t * Subst.Lazy. module_declaration * module_components
835835 | Type_open of Path. t * type_data NameMap. t
836836 | Class_type_open of Path. t * class_type_declaration NameMap. t
837- | Module_type_open of Path. t * modtype_declaration NameMap. t
837+ | Module_type_open of Path. t * Subst.Lazy. modtype_declaration NameMap. t
838838 | Module_open of Path. t * module_data NameMap. t
839839
840840let clda_mode = Mode.Value. (
@@ -2226,20 +2226,15 @@ let short_paths_class_type_open path decls old =
22262226 else Class_type_open (path, decls) :: old
22272227
22282228let short_paths_module_type id decl old =
2229- let decl = Subst.Lazy. force_modtype_decl decl in
22302229 if ! Clflags. real_paths then old
22312230 else Module_type (id, decl) :: old
22322231
22332232let short_paths_module_type_open path decls old =
2234- let decls = NameMap. map
2235- (fun mtda -> Subst.Lazy. force_modtype_decl mtda.mtda_declaration)
2236- decls
2237- in
2233+ let decls = NameMap. map (fun mtda -> mtda.mtda_declaration) decls in
22382234 if ! Clflags. real_paths then old
22392235 else Module_type_open (path, decls) :: old
22402236
22412237let short_paths_module id decl comps old =
2242- let decl = Subst.Lazy. force_module_decl decl in
22432238 if ! Clflags. real_paths then old
22442239 else Module (id, decl, comps) :: old
22452240
@@ -5354,7 +5349,7 @@ let short_paths_class_type_desc clty =
53545349 | ns -> Subst (path, ns)
53555350 end
53565351
5357- let short_paths_module_type_desc mty =
5352+ let short_paths_module_type_desc ( mty : Subst.Lazy.module_type option ) =
53585353 let open Short_paths.Desc.Module_type in
53595354 match mty with
53605355 | None | Some Mty_for_hole -> Fresh
@@ -5378,13 +5373,14 @@ let deprecated_of_alerts alerts =
53785373let deprecated_of_attributes attrs =
53795374 deprecated_of_alerts (Builtin_attributes. alerts_of_attrs attrs)
53805375
5381- let scrape =
5382- (* to be filled with Mtype.scrape_alias *)
5383- ref ((fun _env _mty -> assert false ) : t -> module_type -> module_type)
5376+ let scrape_lazy =
5377+ (* to be filled with Mtype.scrape_lazy *)
5378+ ref ((fun (_env : t ) (_mty : Subst.Lazy.module_type ) : Subst.Lazy. module_type ->
5379+ assert false ))
53845380
53855381let rec short_paths_module_desc env mpath mty comp =
53865382 let open Short_paths.Desc.Module in
5387- match ! scrape env mty with
5383+ match ! scrape_lazy env mty with
53885384 | Mty_alias path -> Alias path
53895385 | Mty_ident _ -> Fresh (Signature (lazy [] ))
53905386 | Mty_signature _ ->
@@ -5423,19 +5419,17 @@ and short_paths_module_components_desc env mpath comp =
54235419 in
54245420 let comps =
54255421 String.Map. fold (fun name mtda acc ->
5426- let mtd = Subst.Lazy. force_modtype_decl mtda.mtda_declaration in
5427- let desc = short_paths_module_type_desc mtd.mtd_type in
5428- let depr = deprecated_of_attributes mtd.mtd_attributes in
5422+ let desc = short_paths_module_type_desc mtda.mtda_declaration.mtd_type in
5423+ let depr = deprecated_of_attributes mtda.mtda_declaration.mtd_attributes in
54295424 let item = Short_paths.Desc.Module. Module_type (name, desc, depr) in
54305425 item :: acc
54315426 ) c.comp_modtypes comps
54325427 in
54335428 let comps =
54345429 String.Map. fold (fun name { mda_declaration; mda_components; _ } acc ->
5435- let mty = Subst.Lazy. force_module_decl mda_declaration in
54365430 let mpath = Pdot (mpath, name) in
54375431 let desc =
5438- short_paths_module_desc env mpath mty .md_type mda_components
5432+ short_paths_module_desc env mpath mda_declaration .md_type mda_components
54395433 in
54405434 let depr = deprecated_of_alerts mda_components.alerts in
54415435 let item = Short_paths.Desc.Module. Module (name, desc, depr) in
@@ -5465,6 +5459,7 @@ and short_paths_functor_components_desc env mpath comp path =
54655459 stamped_path_add f.fcomp_subst_cache path mty;
54665460 mty
54675461 in
5462+ let mty = Subst.Lazy. of_modtype mty in
54685463 let loc = Location. (in_file ! input_name) in
54695464 let comps =
54705465 components_of_functor_appl ~loc ~f_comp: f env ~f_path: mpath ~arg: path
@@ -5492,9 +5487,7 @@ let short_paths_additions_desc env additions =
54925487 let depr = deprecated_of_attributes mtd.mtd_attributes in
54935488 Short_paths.Desc. Module_type (id, desc, source, depr) :: acc
54945489 | Module (id , md , comps ) ->
5495- let desc =
5496- short_paths_module_desc env (Pident id) md.md_type comps
5497- in
5490+ let desc = short_paths_module_desc env (Pident id) md.md_type comps in
54985491 let source = Short_paths.Desc. Local in
54995492 let depr = deprecated_of_alerts comps.alerts in
55005493 Short_paths.Desc. Module (id, desc, source, depr) :: acc
@@ -5520,7 +5513,7 @@ let short_paths_additions_desc env additions =
55205513 decls acc
55215514 | Module_type_open (root , decls ) ->
55225515 String.Map. fold
5523- (fun name mtd acc ->
5516+ (fun name ( mtd : Subst.Lazy.modtype_declaration ) acc ->
55245517 let id = Ident. create_local name in
55255518 let path = Pdot (root, name) in
55265519 let desc = Short_paths.Desc.Module_type. Alias path in
0 commit comments