Skip to content

Commit d92f9a0

Browse files
authored
Merge pull request #4136 from BuckleScript/opaque_parallelism
fix #4135 better parallelism making use of -opaque
2 parents 2749941 + d66c6b0 commit d92f9a0

File tree

11 files changed

+192
-55
lines changed

11 files changed

+192
-55
lines changed

lib/4.06.1/bsb.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4762,7 +4762,7 @@ end = struct
47624762
(* [@@@warning "-37"] *)
47634763
type t =
47644764
(* | File of string *)
4765-
| Dir of string [@@unboxed]
4765+
| Dir of string
47664766

47674767

47684768
let simple_convert_node_path_to_os_path =

lib/4.06.1/bsdep.ml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47825,6 +47825,19 @@ let jsxMapper () =
4782547825
| Pexp_fun (Labelled "ref", _, _, _)
4782647826
| Pexp_fun (Optional "ref", _, _, _) -> raise (Invalid_argument "Ref cannot be passed as a normal prop. Please use `forwardRef` API instead.")
4782747827
| Pexp_fun (arg, default, pattern, expression) when isOptional arg || isLabelled arg ->
47828+
let () =
47829+
(match (isOptional arg, pattern, default) with
47830+
| (true, { ppat_desc = Ppat_constraint (_, { ptyp_desc })}, None) ->
47831+
(match ptyp_desc with
47832+
| Ptyp_constr({txt=(Lident "option")}, [{ ptyp_desc }]) -> ()
47833+
| _ ->
47834+
let currentType = (match ptyp_desc with
47835+
| Ptyp_constr({txt}, []) -> String.concat "." (Longident.flatten txt)
47836+
| Ptyp_constr({txt}, _innerTypeArgs) -> String.concat "." (Longident.flatten txt) ^ "(...)"
47837+
| _ -> "...")
47838+
in
47839+
Location.raise_errorf ~loc:pattern.ppat_loc "ReasonReact: optional argument annotations must have explicit `option`. Did you mean `option(%s)=?`?" currentType)
47840+
| _ -> ()) in
4782847841
let alias = (match pattern with
4782947842
| {ppat_desc = Ppat_alias (_, {txt}) | Ppat_var {txt}} -> txt
4783047843
| {ppat_desc = Ppat_any} -> "_"
@@ -48191,11 +48204,11 @@ let jsxMapper () =
4819148204
| {loc; txt = Ldot (modulePath, ("createElement" | "make"))} ->
4819248205
(match !jsxVersion with
4819348206

48194-
# 878 "syntax/reactjs_jsx_ppx.cppo.ml"
48207+
# 891 "syntax/reactjs_jsx_ppx.cppo.ml"
4819548208
| None
4819648209
| Some 2 -> transformUppercaseCall modulePath mapper loc attrs callExpression callArguments
4819748210

48198-
# 884 "syntax/reactjs_jsx_ppx.cppo.ml"
48211+
# 897 "syntax/reactjs_jsx_ppx.cppo.ml"
4819948212
| Some 3 -> transformUppercaseCall3 modulePath mapper loc attrs callExpression callArguments
4820048213
| Some _ -> raise (Invalid_argument "JSX: the JSX version must be 2 or 3"))
4820148214

@@ -48205,11 +48218,11 @@ let jsxMapper () =
4820548218
| {loc; txt = Lident id} ->
4820648219
(match !jsxVersion with
4820748220

48208-
# 893 "syntax/reactjs_jsx_ppx.cppo.ml"
48221+
# 906 "syntax/reactjs_jsx_ppx.cppo.ml"
4820948222
| None
4821048223
| Some 2 -> transformLowercaseCall mapper loc attrs callArguments id
4821148224

48212-
# 899 "syntax/reactjs_jsx_ppx.cppo.ml"
48225+
# 912 "syntax/reactjs_jsx_ppx.cppo.ml"
4821348226
| Some 3 -> transformLowercaseCall3 mapper loc attrs callArguments id
4821448227
| Some _ -> raise (Invalid_argument "JSX: the JSX version must be 2 or 3"))
4821548228

@@ -48879,6 +48892,19 @@ let jsxMapper () =
4887948892
| Pexp_fun (Labelled "ref", _, _, _)
4888048893
| Pexp_fun (Optional "ref", _, _, _) -> raise (Invalid_argument "Ref cannot be passed as a normal prop. Please use `forwardRef` API instead.")
4888148894
| Pexp_fun (arg, default, pattern, expression) when isOptional arg || isLabelled arg ->
48895+
let () =
48896+
(match (isOptional arg, pattern, default) with
48897+
| (true, { ppat_desc = Ppat_constraint (_, { ptyp_desc })}, None) ->
48898+
(match ptyp_desc with
48899+
| Ptyp_constr({txt=(Lident "option")}, [{ ptyp_desc }]) -> ()
48900+
| _ ->
48901+
let currentType = (match ptyp_desc with
48902+
| Ptyp_constr({txt}, []) -> String.concat "." (Longident.flatten txt)
48903+
| Ptyp_constr({txt}, _innerTypeArgs) -> String.concat "." (Longident.flatten txt) ^ "(...)"
48904+
| _ -> "...")
48905+
in
48906+
Location.raise_errorf ~loc:pattern.ppat_loc "ReasonReact: optional argument annotations must have explicit `option`. Did you mean `option(%s)=?`?" currentType)
48907+
| _ -> ()) in
4888248908
let alias = (match pattern with
4888348909
| {ppat_desc = Ppat_alias (_, {txt}) | Ppat_var {txt}} -> txt
4888448910
| {ppat_desc = Ppat_any} -> "_"
@@ -49245,11 +49271,11 @@ let jsxMapper () =
4924549271
| {loc; txt = Ldot (modulePath, ("createElement" | "make"))} ->
4924649272
(match !jsxVersion with
4924749273

49248-
# 881 "syntax/reactjs_jsx_ppx.cppo.ml"
49274+
# 894 "syntax/reactjs_jsx_ppx.cppo.ml"
4924949275
| Some 2 -> transformUppercaseCall modulePath mapper loc attrs callExpression callArguments
4925049276
| None
4925149277

49252-
# 884 "syntax/reactjs_jsx_ppx.cppo.ml"
49278+
# 897 "syntax/reactjs_jsx_ppx.cppo.ml"
4925349279
| Some 3 -> transformUppercaseCall3 modulePath mapper loc attrs callExpression callArguments
4925449280
| Some _ -> raise (Invalid_argument "JSX: the JSX version must be 2 or 3"))
4925549281

@@ -49259,11 +49285,11 @@ let jsxMapper () =
4925949285
| {loc; txt = Lident id} ->
4926049286
(match !jsxVersion with
4926149287

49262-
# 896 "syntax/reactjs_jsx_ppx.cppo.ml"
49288+
# 909 "syntax/reactjs_jsx_ppx.cppo.ml"
4926349289
| Some 2 -> transformLowercaseCall mapper loc attrs callArguments id
4926449290
| None
4926549291

49266-
# 899 "syntax/reactjs_jsx_ppx.cppo.ml"
49292+
# 912 "syntax/reactjs_jsx_ppx.cppo.ml"
4926749293
| Some 3 -> transformLowercaseCall3 mapper loc attrs callArguments id
4926849294
| Some _ -> raise (Invalid_argument "JSX: the JSX version must be 2 or 3"))
4926949295

lib/4.06.1/bsppx.ml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -306486,6 +306486,19 @@ let jsxMapper () =
306486306486
| Pexp_fun (Labelled "ref", _, _, _)
306487306487
| Pexp_fun (Optional "ref", _, _, _) -> raise (Invalid_argument "Ref cannot be passed as a normal prop. Please use `forwardRef` API instead.")
306488306488
| Pexp_fun (arg, default, pattern, expression) when isOptional arg || isLabelled arg ->
306489+
let () =
306490+
(match (isOptional arg, pattern, default) with
306491+
| (true, { ppat_desc = Ppat_constraint (_, { ptyp_desc })}, None) ->
306492+
(match ptyp_desc with
306493+
| Ptyp_constr({txt=(Lident "option")}, [{ ptyp_desc }]) -> ()
306494+
| _ ->
306495+
let currentType = (match ptyp_desc with
306496+
| Ptyp_constr({txt}, []) -> String.concat "." (Longident.flatten txt)
306497+
| Ptyp_constr({txt}, _innerTypeArgs) -> String.concat "." (Longident.flatten txt) ^ "(...)"
306498+
| _ -> "...")
306499+
in
306500+
Location.raise_errorf ~loc:pattern.ppat_loc "ReasonReact: optional argument annotations must have explicit `option`. Did you mean `option(%s)=?`?" currentType)
306501+
| _ -> ()) in
306489306502
let alias = (match pattern with
306490306503
| {ppat_desc = Ppat_alias (_, {txt}) | Ppat_var {txt}} -> txt
306491306504
| {ppat_desc = Ppat_any} -> "_"
@@ -306852,11 +306865,11 @@ let jsxMapper () =
306852306865
| {loc; txt = Ldot (modulePath, ("createElement" | "make"))} ->
306853306866
(match !jsxVersion with
306854306867

306855-
# 878 "syntax/reactjs_jsx_ppx.cppo.ml"
306868+
# 891 "syntax/reactjs_jsx_ppx.cppo.ml"
306856306869
| None
306857306870
| Some 2 -> transformUppercaseCall modulePath mapper loc attrs callExpression callArguments
306858306871

306859-
# 884 "syntax/reactjs_jsx_ppx.cppo.ml"
306872+
# 897 "syntax/reactjs_jsx_ppx.cppo.ml"
306860306873
| Some 3 -> transformUppercaseCall3 modulePath mapper loc attrs callExpression callArguments
306861306874
| Some _ -> raise (Invalid_argument "JSX: the JSX version must be 2 or 3"))
306862306875

@@ -306866,11 +306879,11 @@ let jsxMapper () =
306866306879
| {loc; txt = Lident id} ->
306867306880
(match !jsxVersion with
306868306881

306869-
# 893 "syntax/reactjs_jsx_ppx.cppo.ml"
306882+
# 906 "syntax/reactjs_jsx_ppx.cppo.ml"
306870306883
| None
306871306884
| Some 2 -> transformLowercaseCall mapper loc attrs callArguments id
306872306885

306873-
# 899 "syntax/reactjs_jsx_ppx.cppo.ml"
306886+
# 912 "syntax/reactjs_jsx_ppx.cppo.ml"
306874306887
| Some 3 -> transformLowercaseCall3 mapper loc attrs callArguments id
306875306888
| Some _ -> raise (Invalid_argument "JSX: the JSX version must be 2 or 3"))
306876306889

@@ -307540,6 +307553,19 @@ let jsxMapper () =
307540307553
| Pexp_fun (Labelled "ref", _, _, _)
307541307554
| Pexp_fun (Optional "ref", _, _, _) -> raise (Invalid_argument "Ref cannot be passed as a normal prop. Please use `forwardRef` API instead.")
307542307555
| Pexp_fun (arg, default, pattern, expression) when isOptional arg || isLabelled arg ->
307556+
let () =
307557+
(match (isOptional arg, pattern, default) with
307558+
| (true, { ppat_desc = Ppat_constraint (_, { ptyp_desc })}, None) ->
307559+
(match ptyp_desc with
307560+
| Ptyp_constr({txt=(Lident "option")}, [{ ptyp_desc }]) -> ()
307561+
| _ ->
307562+
let currentType = (match ptyp_desc with
307563+
| Ptyp_constr({txt}, []) -> String.concat "." (Longident.flatten txt)
307564+
| Ptyp_constr({txt}, _innerTypeArgs) -> String.concat "." (Longident.flatten txt) ^ "(...)"
307565+
| _ -> "...")
307566+
in
307567+
Location.raise_errorf ~loc:pattern.ppat_loc "ReasonReact: optional argument annotations must have explicit `option`. Did you mean `option(%s)=?`?" currentType)
307568+
| _ -> ()) in
307543307569
let alias = (match pattern with
307544307570
| {ppat_desc = Ppat_alias (_, {txt}) | Ppat_var {txt}} -> txt
307545307571
| {ppat_desc = Ppat_any} -> "_"
@@ -307906,11 +307932,11 @@ let jsxMapper () =
307906307932
| {loc; txt = Ldot (modulePath, ("createElement" | "make"))} ->
307907307933
(match !jsxVersion with
307908307934

307909-
# 881 "syntax/reactjs_jsx_ppx.cppo.ml"
307935+
# 894 "syntax/reactjs_jsx_ppx.cppo.ml"
307910307936
| Some 2 -> transformUppercaseCall modulePath mapper loc attrs callExpression callArguments
307911307937
| None
307912307938

307913-
# 884 "syntax/reactjs_jsx_ppx.cppo.ml"
307939+
# 897 "syntax/reactjs_jsx_ppx.cppo.ml"
307914307940
| Some 3 -> transformUppercaseCall3 modulePath mapper loc attrs callExpression callArguments
307915307941
| Some _ -> raise (Invalid_argument "JSX: the JSX version must be 2 or 3"))
307916307942

@@ -307920,11 +307946,11 @@ let jsxMapper () =
307920307946
| {loc; txt = Lident id} ->
307921307947
(match !jsxVersion with
307922307948

307923-
# 896 "syntax/reactjs_jsx_ppx.cppo.ml"
307949+
# 909 "syntax/reactjs_jsx_ppx.cppo.ml"
307924307950
| Some 2 -> transformLowercaseCall mapper loc attrs callArguments id
307925307951
| None
307926307952

307927-
# 899 "syntax/reactjs_jsx_ppx.cppo.ml"
307953+
# 912 "syntax/reactjs_jsx_ppx.cppo.ml"
307928307954
| Some 3 -> transformLowercaseCall3 mapper loc attrs callArguments id
307929307955
| Some _ -> raise (Invalid_argument "JSX: the JSX version must be 2 or 3"))
307930307956

lib/4.06.1/unstable/all_ounit_tests.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6712,7 +6712,7 @@ end = struct
67126712
(* [@@@warning "-37"] *)
67136713
type t =
67146714
(* | File of string *)
6715-
| Dir of string [@@unboxed]
6715+
| Dir of string
67166716

67176717

67186718
let simple_convert_node_path_to_os_path =

lib/4.06.1/unstable/bsb_native.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4762,7 +4762,7 @@ end = struct
47624762
(* [@@@warning "-37"] *)
47634763
type t =
47644764
(* | File of string *)
4765-
| Dir of string [@@unboxed]
4765+
| Dir of string
47664766

47674767

47684768
let simple_convert_node_path_to_os_path =

lib/4.06.1/unstable/bspack.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10286,7 +10286,7 @@ end = struct
1028610286
(* [@@@warning "-37"] *)
1028710287
type t =
1028810288
(* | File of string *)
10289-
| Dir of string [@@unboxed]
10289+
| Dir of string
1029010290

1029110291

1029210292
let simple_convert_node_path_to_os_path =

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102953,7 +102953,7 @@ end = struct
102953102953
(* [@@@warning "-37"] *)
102954102954
type t =
102955102955
(* | File of string *)
102956-
| Dir of string [@@unboxed]
102956+
| Dir of string
102957102957

102958102958

102959102959
let simple_convert_node_path_to_os_path =
@@ -127342,7 +127342,7 @@ let rec
127342127342
we should refresh
127343127343
*)
127344127344
type lam_subst =
127345-
| Id of Lam.t [@@unboxed]
127345+
| Id of Lam.t
127346127346
(* | Refresh of Lam.t *)
127347127347

127348127348
type subst_tbl = (Ident.t list * lam_subst ) Hash_int.t
@@ -129805,6 +129805,19 @@ let jsxMapper () =
129805129805
| Pexp_fun (Labelled "ref", _, _, _)
129806129806
| Pexp_fun (Optional "ref", _, _, _) -> raise (Invalid_argument "Ref cannot be passed as a normal prop. Please use `forwardRef` API instead.")
129807129807
| Pexp_fun (arg, default, pattern, expression) when isOptional arg || isLabelled arg ->
129808+
let () =
129809+
(match (isOptional arg, pattern, default) with
129810+
| (true, { ppat_desc = Ppat_constraint (_, { ptyp_desc })}, None) ->
129811+
(match ptyp_desc with
129812+
| Ptyp_constr({txt=(Lident "option")}, [{ ptyp_desc }]) -> ()
129813+
| _ ->
129814+
let currentType = (match ptyp_desc with
129815+
| Ptyp_constr({txt}, []) -> String.concat "." (Longident.flatten txt)
129816+
| Ptyp_constr({txt}, _innerTypeArgs) -> String.concat "." (Longident.flatten txt) ^ "(...)"
129817+
| _ -> "...")
129818+
in
129819+
Location.raise_errorf ~loc:pattern.ppat_loc "ReasonReact: optional argument annotations must have explicit `option`. Did you mean `option(%s)=?`?" currentType)
129820+
| _ -> ()) in
129808129821
let alias = (match pattern with
129809129822
| {ppat_desc = Ppat_alias (_, {txt}) | Ppat_var {txt}} -> txt
129810129823
| {ppat_desc = Ppat_any} -> "_"
@@ -130171,11 +130184,11 @@ let jsxMapper () =
130171130184
| {loc; txt = Ldot (modulePath, ("createElement" | "make"))} ->
130172130185
(match !jsxVersion with
130173130186

130174-
# 878 "syntax/reactjs_jsx_ppx.cppo.ml"
130187+
# 891 "syntax/reactjs_jsx_ppx.cppo.ml"
130175130188
| None
130176130189
| Some 2 -> transformUppercaseCall modulePath mapper loc attrs callExpression callArguments
130177130190

130178-
# 884 "syntax/reactjs_jsx_ppx.cppo.ml"
130191+
# 897 "syntax/reactjs_jsx_ppx.cppo.ml"
130179130192
| Some 3 -> transformUppercaseCall3 modulePath mapper loc attrs callExpression callArguments
130180130193
| Some _ -> raise (Invalid_argument "JSX: the JSX version must be 2 or 3"))
130181130194

@@ -130185,11 +130198,11 @@ let jsxMapper () =
130185130198
| {loc; txt = Lident id} ->
130186130199
(match !jsxVersion with
130187130200

130188-
# 893 "syntax/reactjs_jsx_ppx.cppo.ml"
130201+
# 906 "syntax/reactjs_jsx_ppx.cppo.ml"
130189130202
| None
130190130203
| Some 2 -> transformLowercaseCall mapper loc attrs callArguments id
130191130204

130192-
# 899 "syntax/reactjs_jsx_ppx.cppo.ml"
130205+
# 912 "syntax/reactjs_jsx_ppx.cppo.ml"
130193130206
| Some 3 -> transformLowercaseCall3 mapper loc attrs callArguments id
130194130207
| Some _ -> raise (Invalid_argument "JSX: the JSX version must be 2 or 3"))
130195130208

@@ -130859,6 +130872,19 @@ let jsxMapper () =
130859130872
| Pexp_fun (Labelled "ref", _, _, _)
130860130873
| Pexp_fun (Optional "ref", _, _, _) -> raise (Invalid_argument "Ref cannot be passed as a normal prop. Please use `forwardRef` API instead.")
130861130874
| Pexp_fun (arg, default, pattern, expression) when isOptional arg || isLabelled arg ->
130875+
let () =
130876+
(match (isOptional arg, pattern, default) with
130877+
| (true, { ppat_desc = Ppat_constraint (_, { ptyp_desc })}, None) ->
130878+
(match ptyp_desc with
130879+
| Ptyp_constr({txt=(Lident "option")}, [{ ptyp_desc }]) -> ()
130880+
| _ ->
130881+
let currentType = (match ptyp_desc with
130882+
| Ptyp_constr({txt}, []) -> String.concat "." (Longident.flatten txt)
130883+
| Ptyp_constr({txt}, _innerTypeArgs) -> String.concat "." (Longident.flatten txt) ^ "(...)"
130884+
| _ -> "...")
130885+
in
130886+
Location.raise_errorf ~loc:pattern.ppat_loc "ReasonReact: optional argument annotations must have explicit `option`. Did you mean `option(%s)=?`?" currentType)
130887+
| _ -> ()) in
130862130888
let alias = (match pattern with
130863130889
| {ppat_desc = Ppat_alias (_, {txt}) | Ppat_var {txt}} -> txt
130864130890
| {ppat_desc = Ppat_any} -> "_"
@@ -131225,11 +131251,11 @@ let jsxMapper () =
131225131251
| {loc; txt = Ldot (modulePath, ("createElement" | "make"))} ->
131226131252
(match !jsxVersion with
131227131253

131228-
# 881 "syntax/reactjs_jsx_ppx.cppo.ml"
131254+
# 894 "syntax/reactjs_jsx_ppx.cppo.ml"
131229131255
| Some 2 -> transformUppercaseCall modulePath mapper loc attrs callExpression callArguments
131230131256
| None
131231131257

131232-
# 884 "syntax/reactjs_jsx_ppx.cppo.ml"
131258+
# 897 "syntax/reactjs_jsx_ppx.cppo.ml"
131233131259
| Some 3 -> transformUppercaseCall3 modulePath mapper loc attrs callExpression callArguments
131234131260
| Some _ -> raise (Invalid_argument "JSX: the JSX version must be 2 or 3"))
131235131261

@@ -131239,11 +131265,11 @@ let jsxMapper () =
131239131265
| {loc; txt = Lident id} ->
131240131266
(match !jsxVersion with
131241131267

131242-
# 896 "syntax/reactjs_jsx_ppx.cppo.ml"
131268+
# 909 "syntax/reactjs_jsx_ppx.cppo.ml"
131243131269
| Some 2 -> transformLowercaseCall mapper loc attrs callArguments id
131244131270
| None
131245131271

131246-
# 899 "syntax/reactjs_jsx_ppx.cppo.ml"
131272+
# 912 "syntax/reactjs_jsx_ppx.cppo.ml"
131247131273
| Some 3 -> transformLowercaseCall3 mapper loc attrs callArguments id
131248131274
| Some _ -> raise (Invalid_argument "JSX: the JSX version must be 2 or 3"))
131249131275

0 commit comments

Comments
 (0)