@@ -102953,7 +102953,7 @@ end = struct
102953102953(* [@@@warning "-37"] *)
102954102954type t =
102955102955 (* | File of string *)
102956- | Dir of string [@@unboxed]
102956+ | Dir of string
102957102957
102958102958
102959102959let simple_convert_node_path_to_os_path =
@@ -127342,7 +127342,7 @@ let rec
127342127342 we should refresh
127343127343 *)
127344127344type lam_subst =
127345- | Id of Lam.t [@@unboxed]
127345+ | Id of Lam.t
127346127346 (* | Refresh of Lam.t *)
127347127347
127348127348type 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