Skip to content

Commit 5394352

Browse files
authored
flambda-backend: Only substitute once in Env.read_sign_of_cmi (#1670)
This is mostly a cleanup, but it does mean that substitution will happen with the `Make_local` scoping policy rather than `Rescope`. At one point `Rescope` was necessary to work around a problem in `Includemod` but no longer.
1 parent 2a7f015 commit 5394352

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

boot/ocamlc

-2.85 KB
Binary file not shown.

boot/ocamllex

-313 Bytes
Binary file not shown.

typing/env.ml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,7 @@ let read_sign_of_cmi { Persistent_env.Persistent_signature.cmi; _ } =
937937
Misc.Stdlib.String.Map.empty
938938
flags
939939
in
940+
let sign = Subst.Lazy.signature Make_local Subst.identity sign in
940941
let md =
941942
{ Subst.Lazy.md_type = Mty_signature sign;
942943
md_loc = Location.none;
@@ -945,18 +946,12 @@ let read_sign_of_cmi { Persistent_env.Persistent_signature.cmi; _ } =
945946
}
946947
in
947948
let mda_address = Lazy_backtrack.create_forced (Aunit name) in
948-
let mda_declaration =
949-
Subst.(Lazy.module_decl Make_local identity md)
950-
in
949+
let mda_declaration = md in
951950
let mda_shape =
952951
Shape.for_persistent_unit (name |> Compilation_unit.full_path_as_string)
953952
in
954953
let mda_components =
955-
let mty = Subst.Lazy.Mty_signature sign in
956-
let mty =
957-
Subst.Lazy.modtype (Subst.Rescope (Path.scope path))
958-
Subst.identity mty
959-
in
954+
let mty = md.md_type in
960955
components_of_module ~alerts ~uid:md.md_uid
961956
empty Subst.identity
962957
path mda_address mty mda_shape

0 commit comments

Comments
 (0)