File tree Expand file tree Collapse file tree 7 files changed +46
-5
lines changed Expand file tree Collapse file tree 7 files changed +46
-5
lines changed Original file line number Diff line number Diff line change 1010> - :house : [ Internal]
1111> - :nail_care : [ Polish]
1212
13+ # 10.1.0-rc.5
14+
15+ #### :bug : Bug Fix
16+
17+ - Prevent inlining of async functions in last stage of the compiler when the functions are not exported (not in interface file or shadowed) https://github.com/rescript-lang/rescript-compiler/pull/5790
18+
1319# 10.1.0-rc.4
1420
1521#### :rocket : New Feature
Original file line number Diff line number Diff line change @@ -165,7 +165,7 @@ let subst (export_set : Set_ident.t) stats =
165165 Some
166166 {
167167 expression_desc =
168- Fun {is_method= false ; params; body; env};
168+ Fun {is_method= false ; params; body; env; async = false };
169169 comment = _;
170170 };
171171 (* TODO: don't inline method tail call yet,
Original file line number Diff line number Diff line change 11'use strict' ;
22
3+ var Curry = require ( "../../lib/js/curry.js" ) ;
34
45async function willBeInlined ( param ) {
56 return 3 ;
@@ -14,7 +15,25 @@ function wrapSomethingAsync(param) {
1415 } ) ( 777 ) ) ;
1516}
1617
18+ async function doSomethingAsync ( someAsyncFunction ) {
19+ return await Curry . _1 ( someAsyncFunction , undefined ) ;
20+ }
21+
22+ var broken = doSomethingAsync ;
23+
24+ var M = {
25+ broken : broken
26+ } ;
27+
28+ async function broken$1 ( someAsyncFunction ) {
29+ return await Curry . _1 ( someAsyncFunction , undefined ) ;
30+ }
31+
32+ var broken$2 = broken$1 ;
33+
1734exports . willBeInlined = willBeInlined ;
1835exports . inlined = inlined ;
1936exports . wrapSomethingAsync = wrapSomethingAsync ;
37+ exports . M = M ;
38+ exports . broken = broken$2 ;
2039/* inlined Not a pure module */
Original file line number Diff line number Diff line change @@ -9,4 +9,20 @@ let wrapSomethingAsync: unit => unit = () => {
99 Js .log (test )
1010 }
1111 )(777 )
12- }
12+ }
13+
14+ module M : {
15+ let broken : (unit => promise <'a >) => promise <'a >
16+ } = {
17+ let doSomethingAsync = async (someAsyncFunction ) => {
18+ await someAsyncFunction ()
19+ }
20+
21+ let broken = someAsyncFunction => doSomethingAsync (someAsyncFunction )
22+ }
23+
24+ let broken = async (someAsyncFunction ) => {
25+ await someAsyncFunction ()
26+ }
27+
28+ let broken = someAsyncFunction => broken (someAsyncFunction )
Original file line number Diff line number Diff line change @@ -92734,7 +92734,7 @@ let subst (export_set : Set_ident.t) stats =
9273492734 Some
9273592735 {
9273692736 expression_desc =
92737- Fun {is_method=false; params; body; env};
92737+ Fun {is_method=false; params; body; env; async=false };
9273892738 comment = _;
9273992739 };
9274092740 (*TODO: don't inline method tail call yet,
Original file line number Diff line number Diff line change @@ -92734,7 +92734,7 @@ let subst (export_set : Set_ident.t) stats =
9273492734 Some
9273592735 {
9273692736 expression_desc =
92737- Fun {is_method=false; params; body; env};
92737+ Fun {is_method=false; params; body; env; async=false };
9273892738 comment = _;
9273992739 };
9274092740 (*TODO: don't inline method tail call yet,
Original file line number Diff line number Diff line change @@ -262095,7 +262095,7 @@ let subst (export_set : Set_ident.t) stats =
262095262095 Some
262096262096 {
262097262097 expression_desc =
262098- Fun {is_method=false; params; body; env};
262098+ Fun {is_method=false; params; body; env; async=false };
262099262099 comment = _;
262100262100 };
262101262101 (*TODO: don't inline method tail call yet,
You can’t perform that action at this time.
0 commit comments