@@ -2364,7 +2364,14 @@ and type_expect_ ?type_clash_context ?in_function ?(recarg = Rejected) env sexp
2364
2364
exp_env = env;
2365
2365
}
2366
2366
| Pexp_fun
2367
- {arg_label = l; default = Some default; lhs = spat; rhs = sbody; arity} ->
2367
+ {
2368
+ arg_label = l;
2369
+ default = Some default;
2370
+ lhs = spat;
2371
+ rhs = sbody;
2372
+ arity;
2373
+ async;
2374
+ } ->
2368
2375
assert (is_optional l);
2369
2376
(* default allowed only with optional argument *)
2370
2377
let open Ast_helper in
@@ -2402,10 +2409,13 @@ and type_expect_ ?type_clash_context ?in_function ?(recarg = Rejected) env sexp
2402
2409
[Vb. mk spat smatch]
2403
2410
sbody
2404
2411
in
2405
- type_function ?in_function ~arity loc sexp.pexp_attributes env ty_expected l
2412
+ type_function ?in_function ~arity ~async loc sexp.pexp_attributes env
2413
+ ty_expected l
2406
2414
[Exp. case pat body]
2407
- | Pexp_fun {arg_label = l ; default = None ; lhs = spat ; rhs = sbody ; arity} ->
2408
- type_function ?in_function ~arity loc sexp.pexp_attributes env ty_expected l
2415
+ | Pexp_fun
2416
+ {arg_label = l; default = None ; lhs = spat; rhs = sbody; arity; async} ->
2417
+ type_function ?in_function ~arity ~async loc sexp.pexp_attributes env
2418
+ ty_expected l
2409
2419
[Ast_helper.Exp. case spat sbody]
2410
2420
| Pexp_apply (sfunct , sargs ) ->
2411
2421
assert (sargs <> [] );
@@ -3246,7 +3256,8 @@ and type_expect_ ?type_clash_context ?in_function ?(recarg = Rejected) env sexp
3246
3256
| Pexp_extension ext ->
3247
3257
raise (Error_forward (Builtin_attributes. error_of_extension ext))
3248
3258
3249
- and type_function ?in_function ~arity loc attrs env ty_expected_ l caselist =
3259
+ and type_function ?in_function ~arity ~async loc attrs env ty_expected_ l
3260
+ caselist =
3250
3261
let state = Warnings. backup () in
3251
3262
(* Disable Unerasable_optional_argument for uncurried functions *)
3252
3263
let unerasable_optional_argument =
@@ -3304,7 +3315,8 @@ and type_function ?in_function ~arity loc attrs env ty_expected_ l caselist =
3304
3315
Warnings. restore state;
3305
3316
re
3306
3317
{
3307
- exp_desc = Texp_function {arg_label = l; arity; param; case; partial};
3318
+ exp_desc =
3319
+ Texp_function {arg_label = l; arity; param; case; partial; async};
3308
3320
exp_loc = loc;
3309
3321
exp_extra = [] ;
3310
3322
exp_type;
0 commit comments