File tree 7 files changed +46
-5
lines changed
7 files changed +46
-5
lines changed Original file line number Diff line number Diff line change 10
10
> - :house : [ Internal]
11
11
> - :nail_care : [ Polish]
12
12
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
+
13
19
# 10.1.0-rc.4
14
20
15
21
#### :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 =
165
165
Some
166
166
{
167
167
expression_desc =
168
- Fun {is_method= false ; params; body; env};
168
+ Fun {is_method= false ; params; body; env; async = false };
169
169
comment = _;
170
170
};
171
171
(* TODO: don't inline method tail call yet,
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
3
+ var Curry = require ( "../../lib/js/curry.js" ) ;
3
4
4
5
async function willBeInlined ( param ) {
5
6
return 3 ;
@@ -14,7 +15,25 @@ function wrapSomethingAsync(param) {
14
15
} ) ( 777 ) ) ;
15
16
}
16
17
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
+
17
34
exports . willBeInlined = willBeInlined ;
18
35
exports . inlined = inlined ;
19
36
exports . wrapSomethingAsync = wrapSomethingAsync ;
37
+ exports . M = M ;
38
+ exports . broken = broken$2 ;
20
39
/* inlined Not a pure module */
Original file line number Diff line number Diff line change @@ -9,4 +9,20 @@ let wrapSomethingAsync: unit => unit = () => {
9
9
Js .log (test )
10
10
}
11
11
)(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 =
92734
92734
Some
92735
92735
{
92736
92736
expression_desc =
92737
- Fun {is_method=false; params; body; env};
92737
+ Fun {is_method=false; params; body; env; async=false };
92738
92738
comment = _;
92739
92739
};
92740
92740
(*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 =
92734
92734
Some
92735
92735
{
92736
92736
expression_desc =
92737
- Fun {is_method=false; params; body; env};
92737
+ Fun {is_method=false; params; body; env; async=false };
92738
92738
comment = _;
92739
92739
};
92740
92740
(*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 =
262095
262095
Some
262096
262096
{
262097
262097
expression_desc =
262098
- Fun {is_method=false; params; body; env};
262098
+ Fun {is_method=false; params; body; env; async=false };
262099
262099
comment = _;
262100
262100
};
262101
262101
(*TODO: don't inline method tail call yet,
You can’t perform that action at this time.
0 commit comments