@@ -628,7 +628,8 @@ let map_binding ~config ~empty_loc ~pstr_loc ~file_name ~rec_flag binding =
628628 (* let make = React.forwardRef({
629629 let \"App" = (props, ref) => make({...props, ref: @optional (Js.Nullabel.toOption(ref))})
630630 })*)
631- Exp. fun_ ~arity: None Nolabel None
631+ let total_arity = if has_forward_ref then 2 else 1 in
632+ Exp. fun_ ~arity: (Some total_arity) Nolabel None
632633 (match core_type_of_attr with
633634 | None -> make_props_pattern named_type_list
634635 | Some _ -> make_props_pattern typ_vars_of_core_type)
@@ -639,10 +640,6 @@ let map_binding ~config ~empty_loc ~pstr_loc ~file_name ~rec_flag binding =
639640 else inner_expression)
640641 ~attrs: binding.pvb_expr.pexp_attributes
641642 in
642- let full_expression =
643- full_expression
644- |> Ast_uncurried. uncurried_fun ~arity: (if has_forward_ref then 2 else 1 )
645- in
646643 let full_expression =
647644 match full_module_name with
648645 | "" -> full_expression
@@ -764,7 +761,8 @@ let map_binding ~config ~empty_loc ~pstr_loc ~file_name ~rec_flag binding =
764761 in
765762 let expression =
766763 (* Shape internal implementation to match wrapper: uncurried when using forwardRef. *)
767- Exp. fun_ ~arity: (Some 1 ) ~async: is_async Nolabel None
764+ let total_arity = if has_forward_ref then 2 else 1 in
765+ Exp. fun_ ~arity: (Some total_arity) ~async: is_async Nolabel None
768766 (Pat. constraint_ record_pattern
769767 (Typ. constr ~loc: empty_loc
770768 {txt = Lident " props" ; loc = empty_loc}
@@ -779,10 +777,6 @@ let map_binding ~config ~empty_loc ~pstr_loc ~file_name ~rec_flag binding =
779777 | _ -> [Typ. any () ]))))
780778 expression
781779 in
782- let expression =
783- if has_forward_ref then expression |> Ast_uncurried. uncurried_fun ~arity: 2
784- else expression
785- in
786780 let expression =
787781 (* Add new tupes (type a,b,c) to make's definition *)
788782 newtypes
@@ -887,12 +881,9 @@ let map_binding ~config ~empty_loc ~pstr_loc ~file_name ~rec_flag binding =
887881 in
888882 let applied_expression = constrain_jsx_return applied_expression in
889883 let wrapper_expr =
890- Exp. fun_ ~arity: None Nolabel None props_pattern
884+ Exp. fun_ ~arity: ( Some 1 ) Nolabel None props_pattern
891885 ~attrs: binding.pvb_expr.pexp_attributes applied_expression
892886 in
893-
894- let wrapper_expr = Ast_uncurried. uncurried_fun ~arity: 1 wrapper_expr in
895-
896887 let internal_expression =
897888 Exp. let_ Nonrecursive
898889 [Vb. mk (Pat. var {txt = full_module_name; loc}) wrapper_expr]
0 commit comments