Skip to content

Make application default to uncurried at the lambda level. #6894

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jscomp/core/lam_convert.ml
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ let convert (exports : Set_ident.t) (lam : Lambda.lambda) :
(* we need do this eargly in case [aux fn] add some wrapper *)
Lam.apply (convert_aux fn)
(Ext_list.map args convert_aux)
{ ap_loc = loc; ap_inlined; ap_status = App_na }
{ ap_loc = loc; ap_inlined; ap_status = App_uncurry }
| Lfunction { params; body; attr } ->
let new_map, body =
rename_optional_parameters Map_ident.empty params body
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 12 additions & 10 deletions jscomp/gentype_tests/typescript-react-example/src/Hooks.res.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions jscomp/ml/translcore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1036,14 +1036,8 @@ and transl_cases_try cases =
List.map transl_case_try cases

and transl_apply ?(inlined = Default_inline) ?(uncurried_partial_application=None) lam sargs loc =
let lapply funct args =
match funct with
(* Attention: This may not be what we need to change the application arity*)
| Lapply ap -> Lapply { ap with ap_args = ap.ap_args @ args; ap_loc = loc }
| lexp ->
Lapply
{ ap_loc = loc; ap_func = lexp; ap_args = args; ap_inlined = inlined }
in
let lapply ap_func ap_args =
Lapply { ap_loc = loc; ap_func; ap_args; ap_inlined = inlined } in
let rec build_apply lam args = function
| (None, optional) :: l ->
let defs = ref [] in
Expand Down
Loading