Skip to content

Commit 94ac53e

Browse files
committed
1 parent eb4c157 commit 94ac53e

6 files changed

+36
-10
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
- Reactivate unused attribute check for `@int`. https://github.com/rescript-lang/rescript-compiler/pull/6802
4343
- Fix Deno compatibility issues on Windows. https://github.com/rescript-lang/rescript-compiler/pull/6850
4444
- Fix issue with infinite loops with type errors on recursive types. https://github.com/rescript-lang/rescript-compiler/pull/6867
45+
- Fix issue where using partial application `...` can generate code that uses `Curry` at runtime. https://github.com/rescript-lang/rescript-compiler/pull/6872
4546

4647
#### :house: Internal
4748

jscomp/ml/translcore.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1099,16 +1099,16 @@ and transl_apply ?(inlined = Default_inline) ?(uncurried_partial_application=Non
10991099
let id_arg = Ident.create "none" in
11001100
none_ids := id_arg :: !none_ids;
11011101
Some (Lvar id_arg)) in
1102-
let extra_ids = ref [] in
1103-
extra_ids := Ident.create "extra" :: !extra_ids;
11041102
let extra_ids = Array.init extra_arity (fun _ -> Ident.create "extra") |> Array.to_list in
11051103
let extra_args = Ext_list.map extra_ids (fun id -> Lvar id) in
11061104
let ap_args = args @ extra_args in
1107-
let l0 = Lapply { ap_func = lam; ap_args; ap_inlined = inlined; ap_loc = loc } in
1105+
let lam_opaque = Lprim (Popaque, [lam], loc) in
1106+
let l0 = Lapply { ap_func = lam_opaque; ap_args; ap_inlined = inlined; ap_loc = loc } in
1107+
let l1 = Lprim (Puncurried_apply, [l0], loc) in
11081108
Lfunction
11091109
{
11101110
params = List.rev_append !none_ids extra_ids ;
1111-
body = l0;
1111+
body = l1;
11121112
attr = default_function_attribute;
11131113
loc;
11141114
}

jscomp/test/PartialApplicationNoRuntimeCurry.js

+20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@@uncurried
2+
3+
let add = x => (y, z) => x + y + z
4+
5+
let f = u => {
6+
let f = add(u)
7+
f(1, ...)
8+
}

jscomp/test/UncurriedAlways.js

+1-5
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jscomp/test/build.ninja

+2-1
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)