File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,18 @@ let projects_bitset_of_path ~opts path =
6464
| Some (_, bitset) -> Some bitset
6565
| None -> None)
6666

67+
(**
68+
* Suppose we have web and native project, and some paths that can be part of both web and native.
69+
* Then this function will return which projects' files can be accessed by the given project.
70+
*
71+
* This is used to enforce that web code can use both web and web+native code, while web+native code
72+
* can only import web+native code. However, the latter is temporarily allowed for experimentation.
73+
*)
6774
let reachable_projects_bitsets_from_projects_bitset ~opts p =
6875
let size = Nel.length opts.projects in
76+
(* 1-project code can reach into common code.
77+
* e.g. Suppose that we have two projects web and native.
78+
* Web code can use common code (web+native). *)
6979
let additional =
7080
Base.List.find_mapi (Nel.to_list opts.projects) ~f:(fun i _ ->
7181
if Bitset.equal p (Bitset.set i (Bitset.all_zero size)) then
@@ -74,6 +84,12 @@ let reachable_projects_bitsets_from_projects_bitset ~opts p =
7484
None
7585
)
7686
in
87+
(* Temporary hack: common code can reach into 1-project code.
88+
* e.g. Suppose that we have two projects web and native.
89+
* We temporarily allow common code (web+native) to use web-only code.
90+
* This is of course incorrect, and we should move these web-only code into common code instead.
91+
* However, the temporary measure exists so that we can still have good type coverage during
92+
* experimentation before we can lock down the boundary. *)
7793
let additional =
7894
match additional with
7995
| Some _ -> additional

0 commit comments

Comments
 (0)