Skip to content

Commit fe0e194

Browse files
authored
Merge pull request #196 from oxcaml/fix-param-libs-shortpath
2 parents 3d3013f + 36f3f7f commit fe0e194

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

src/ocaml/typing/persistent_env.ml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ let register_pers_for_short_paths penv modname ps components =
330330
let crc = Import_info.crc import in
331331
name, crc)
332332
in
333-
let deps, alias_deps =
333+
let depends, alias_depends =
334334
List.fold_left
335335
(fun (deps, alias_deps) (name, digest) ->
336336
let name_as_string = Compilation_unit.Name.to_string name in
@@ -356,10 +356,9 @@ let register_pers_for_short_paths penv modname ps components =
356356
if is_deprecated then Short_paths.Desc.Deprecated
357357
else Short_paths.Desc.Not_deprecated
358358
in
359-
(* CR parameterized modules: this will probably break with parameterized modules *)
360-
let modname_as_string = Global_module.Name.to_string modname in
361-
Short_paths.Basis.load (short_paths_basis penv) modname_as_string
362-
deps alias_deps desc ps.ps_name_info.pn_import.imp_visibility deprecated
359+
(* CR parameterized modules: [depends] and [alias_depends] are missing instantiation. *)
360+
Short_paths.Basis.load (short_paths_basis penv) modname
361+
~depends ~alias_depends desc ps.ps_name_info.pn_import.imp_visibility deprecated
363362
(* Reading persistent structures from .cmi files *)
364363

365364
let save_import penv crc modname impl flags filename =

src/ocaml/typing/short_paths.ml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,7 +1739,7 @@ module String_set = Set.Make(String)
17391739
module Basis = struct
17401740

17411741
type load =
1742-
{ name : string;
1742+
{ name : Global_module.Name.t;
17431743
depends : string list;
17441744
alias_depends : string list;
17451745
desc : Desc.Module.t;
@@ -1775,7 +1775,7 @@ module Basis = struct
17751775
Rev_deps.extend_up_to t.rev_deps t.next_dep;
17761776
List.iter
17771777
(fun { name; depends; alias_depends; _ } ->
1778-
let index = String_map.find name t.assignment in
1778+
let index = String_map.find name.Global_module.Name.head t.assignment in
17791779
List.iter
17801780
(fun dep_name ->
17811781
let dep_index = String_map.find dep_name t.assignment in
@@ -1792,7 +1792,7 @@ module Basis = struct
17921792
let components =
17931793
List.map
17941794
(fun { name; desc; visibility=load_visibility; deprecated; _ } ->
1795-
let index = String_map.find name t.assignment in
1795+
let index = String_map.find name.Global_module.Name.head t.assignment in
17961796
let origin = Origin.Dependency index in
17971797
let id = Ident.global name in
17981798
let component_visibility : Desc.visibility =
@@ -1808,6 +1808,7 @@ module Basis = struct
18081808
(fun name acc ->
18091809
let index = String_map.find name t.assignment in
18101810
let origin = Origin.Dependency index in
1811+
let name = Global_module.Name.create_no_args name in
18111812
let id = Ident.global name in
18121813
Component.Declare_module(origin, id) :: acc)
18131814
additions
@@ -1844,7 +1845,7 @@ module Basis = struct
18441845
let add t name =
18451846
t.pending_additions <- String_set.add name t.pending_additions
18461847

1847-
let load t name depends alias_depends desc visibility deprecated =
1848+
let load t name ~depends ~alias_depends desc visibility deprecated =
18481849
let load = { name; depends; alias_depends; desc; visibility; deprecated } in
18491850
t.pending_loads <- load :: t.pending_loads
18501851

src/ocaml/typing/short_paths.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module Basis : sig
99

1010
val add : t -> string -> unit
1111

12-
val load : t -> string -> string list -> string list ->
12+
val load : t -> Global_module.Name.t -> depends:string list -> alias_depends:string list ->
1313
Desc.Module.t -> Load_path.visibility -> Desc.deprecated -> unit
1414

1515
end

src/ocaml/typing/short_paths_graph.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module Ident = struct
1212
let name = Ident.name
1313

1414
let global name =
15-
Ident.create_persistent name
15+
Ident.create_global name
1616

1717
end
1818

src/ocaml/typing/short_paths_graph.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module Ident : sig
2020

2121
val name : t -> string
2222

23-
val global : string -> t
23+
val global : Global_module.Name.t -> t
2424

2525
end
2626

0 commit comments

Comments
 (0)