Skip to content

Commit d2046db

Browse files
committed
snap
1 parent 0fb84ab commit d2046db

File tree

3 files changed

+54
-12
lines changed

3 files changed

+54
-12
lines changed

lib/4.06.1/unstable/js_compiler.ml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154477,6 +154477,11 @@ let transformStructureItem ~config mapper item =
154477154477
config.hasReactComponent <- true;
154478154478
check_string_int_attribute_iter.structure_item
154479154479
check_string_int_attribute_iter item;
154480+
let pval_type =
154481+
match pval_type.ptyp_desc with
154482+
| Ptyp_constr ({txt = Ldot (Ldot (Lident "Js", "Fn"), _)}, [t]) -> t
154483+
| _ -> pval_type
154484+
in
154480154485
let coreTypeOfAttr = React_jsx_common.coreTypeOfAttrs pval_attributes in
154481154486
let typVarsOfCoreType =
154482154487
coreTypeOfAttr
@@ -154543,12 +154548,21 @@ let transformStructureItem ~config mapper item =
154543154548
React_jsx_common.raiseErrorMultipleReactComponent ~loc:pstr_loc
154544154549
else (
154545154550
config.hasReactComponent <- true;
154546-
let binding =
154547-
match binding.pvb_expr.pexp_desc with
154551+
let rec removeArityRecord expr =
154552+
match expr.pexp_desc with
154548154553
| Pexp_record
154549154554
([({txt = Ldot (Ldot (Lident "Js", "Fn"), _)}, e)], None) ->
154550-
{binding with pvb_expr = e}
154551-
| _ -> binding
154555+
e
154556+
| Pexp_apply (forwardRef, [(label, e)]) ->
154557+
{
154558+
expr with
154559+
pexp_desc =
154560+
Pexp_apply (forwardRef, [(label, removeArityRecord e)]);
154561+
}
154562+
| _ -> expr
154563+
in
154564+
let binding =
154565+
{binding with pvb_expr = removeArityRecord binding.pvb_expr}
154552154566
in
154553154567
let coreTypeOfAttr =
154554154568
React_jsx_common.coreTypeOfAttrs binding.pvb_attributes

lib/4.06.1/unstable/js_playground_compiler.ml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154477,6 +154477,11 @@ let transformStructureItem ~config mapper item =
154477154477
config.hasReactComponent <- true;
154478154478
check_string_int_attribute_iter.structure_item
154479154479
check_string_int_attribute_iter item;
154480+
let pval_type =
154481+
match pval_type.ptyp_desc with
154482+
| Ptyp_constr ({txt = Ldot (Ldot (Lident "Js", "Fn"), _)}, [t]) -> t
154483+
| _ -> pval_type
154484+
in
154480154485
let coreTypeOfAttr = React_jsx_common.coreTypeOfAttrs pval_attributes in
154481154486
let typVarsOfCoreType =
154482154487
coreTypeOfAttr
@@ -154543,12 +154548,21 @@ let transformStructureItem ~config mapper item =
154543154548
React_jsx_common.raiseErrorMultipleReactComponent ~loc:pstr_loc
154544154549
else (
154545154550
config.hasReactComponent <- true;
154546-
let binding =
154547-
match binding.pvb_expr.pexp_desc with
154551+
let rec removeArityRecord expr =
154552+
match expr.pexp_desc with
154548154553
| Pexp_record
154549154554
([({txt = Ldot (Ldot (Lident "Js", "Fn"), _)}, e)], None) ->
154550-
{binding with pvb_expr = e}
154551-
| _ -> binding
154555+
e
154556+
| Pexp_apply (forwardRef, [(label, e)]) ->
154557+
{
154558+
expr with
154559+
pexp_desc =
154560+
Pexp_apply (forwardRef, [(label, removeArityRecord e)]);
154561+
}
154562+
| _ -> expr
154563+
in
154564+
let binding =
154565+
{binding with pvb_expr = removeArityRecord binding.pvb_expr}
154552154566
in
154553154567
let coreTypeOfAttr =
154554154568
React_jsx_common.coreTypeOfAttrs binding.pvb_attributes

lib/4.06.1/whole_compiler.ml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164761,6 +164761,11 @@ let transformStructureItem ~config mapper item =
164761164761
config.hasReactComponent <- true;
164762164762
check_string_int_attribute_iter.structure_item
164763164763
check_string_int_attribute_iter item;
164764+
let pval_type =
164765+
match pval_type.ptyp_desc with
164766+
| Ptyp_constr ({txt = Ldot (Ldot (Lident "Js", "Fn"), _)}, [t]) -> t
164767+
| _ -> pval_type
164768+
in
164764164769
let coreTypeOfAttr = React_jsx_common.coreTypeOfAttrs pval_attributes in
164765164770
let typVarsOfCoreType =
164766164771
coreTypeOfAttr
@@ -164827,12 +164832,21 @@ let transformStructureItem ~config mapper item =
164827164832
React_jsx_common.raiseErrorMultipleReactComponent ~loc:pstr_loc
164828164833
else (
164829164834
config.hasReactComponent <- true;
164830-
let binding =
164831-
match binding.pvb_expr.pexp_desc with
164835+
let rec removeArityRecord expr =
164836+
match expr.pexp_desc with
164832164837
| Pexp_record
164833164838
([({txt = Ldot (Ldot (Lident "Js", "Fn"), _)}, e)], None) ->
164834-
{binding with pvb_expr = e}
164835-
| _ -> binding
164839+
e
164840+
| Pexp_apply (forwardRef, [(label, e)]) ->
164841+
{
164842+
expr with
164843+
pexp_desc =
164844+
Pexp_apply (forwardRef, [(label, removeArityRecord e)]);
164845+
}
164846+
| _ -> expr
164847+
in
164848+
let binding =
164849+
{binding with pvb_expr = removeArityRecord binding.pvb_expr}
164836164850
in
164837164851
let coreTypeOfAttr =
164838164852
React_jsx_common.coreTypeOfAttrs binding.pvb_attributes

0 commit comments

Comments
 (0)