@@ -64,8 +64,18 @@ let projects_bitset_of_path ~opts path =
64
64
| Some (_ , bitset ) -> Some bitset
65
65
| None -> None )
66
66
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
+ *)
67
74
let reachable_projects_bitsets_from_projects_bitset ~opts p =
68
75
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). *)
69
79
let additional =
70
80
Base.List. find_mapi (Nel. to_list opts.projects) ~f: (fun i _ ->
71
81
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 =
74
84
None
75
85
)
76
86
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. *)
77
93
let additional =
78
94
match additional with
79
95
| Some _ -> additional
0 commit comments