File tree 3 files changed +35
-5
lines changed
3 files changed +35
-5
lines changed Original file line number Diff line number Diff line change @@ -196,11 +196,13 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
196
196
({
197
197
pmod_desc =
198
198
Pmod_constraint
199
- ({pmod_desc = Pmod_ident _}, {pmty_desc = Pmty_ident mtyp_lid});
200
- pmod_attributes;
199
+ ( {pmod_desc = Pmod_ident _; pmod_attributes = attrs1},
200
+ {pmty_desc = Pmty_ident mtyp_lid} );
201
+ pmod_attributes = attrs2;
201
202
} as me),
202
203
expr )
203
- when Res_parsetree_viewer. has_await_attribute pmod_attributes ->
204
+ when Res_parsetree_viewer. has_await_attribute attrs1
205
+ || Res_parsetree_viewer. has_await_attribute attrs2 ->
204
206
{
205
207
e with
206
208
pexp_desc =
@@ -224,14 +226,20 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
224
226
in
225
227
match e.pexp_desc with
226
228
| Pexp_letmodule (_, {pmod_desc = Pmod_ident _; pmod_attributes}, _)
229
+ when Ast_attributes. has_await_payload pmod_attributes ->
230
+ check_await () ;
231
+ result
227
232
| Pexp_letmodule
228
233
( _,
229
234
{
230
235
pmod_desc =
231
- Pmod_constraint ({pmod_desc = Pmod_ident _; pmod_attributes}, _);
236
+ Pmod_constraint
237
+ ({pmod_desc = Pmod_ident _; pmod_attributes = attrs1}, _);
238
+ pmod_attributes = attrs2;
232
239
},
233
240
_ )
234
- when Ast_attributes. has_await_payload pmod_attributes ->
241
+ when Ast_attributes. has_await_payload attrs1
242
+ || Ast_attributes. has_await_payload attrs2 ->
235
243
check_await () ;
236
244
result
237
245
| _ when Ast_attributes. has_await_payload e.pexp_attributes ->
Original file line number Diff line number Diff line change @@ -34,6 +34,14 @@ async function f(value) {
34
34
return await Promise . resolve ( 1 ) ;
35
35
}
36
36
37
+ async function f0 ( ) {
38
+ return ( await import ( "rescript/lib/es6/Belt_Option.js" ) ) . forEach ;
39
+ }
40
+
41
+ async function f1 ( ) {
42
+ return ( await import ( "rescript/lib/es6/Belt_Option.js" ) ) . forEach ;
43
+ }
44
+
37
45
export {
38
46
next ,
39
47
useNext ,
@@ -43,5 +51,7 @@ export {
43
51
toplevelAwait ,
44
52
toplevelAwait2 ,
45
53
f ,
54
+ f0 ,
55
+ f1 ,
46
56
}
47
57
/* toplevelAwait Not a pure module */
Original file line number Diff line number Diff line change @@ -18,3 +18,15 @@ let toplevelAwait2 = arr[await topFoo()]
18
18
let f = async (type input , value : input ) => {
19
19
await Js .Promise .resolve (1 )
20
20
}
21
+
22
+ module type MT = module type of Belt .Option
23
+
24
+ let f0 = async () => {
25
+ module O = await Belt .Option
26
+ O .forEach
27
+ }
28
+
29
+ let f1 = async () => {
30
+ module O : MT = await Belt .Option
31
+ O .forEach
32
+ }
You can’t perform that action at this time.
0 commit comments