@@ -136,7 +136,7 @@ let iter_expression f e =
136
136
| Pexp_extension _ (* we don't iterate under extension point *)
137
137
| Pexp_ident _ | Pexp_new _ | Pexp_constant _ ->
138
138
()
139
- | Pexp_fun ( _ , eo , _ , e , _ ) ->
139
+ | Pexp_fun { default = eo ; rhs = e } ->
140
140
may expr eo;
141
141
expr e
142
142
| Pexp_apply (e , lel ) ->
@@ -1905,7 +1905,7 @@ let rec approx_type env sty =
1905
1905
let rec type_approx env sexp =
1906
1906
match sexp.pexp_desc with
1907
1907
| Pexp_let (_ , _ , e ) -> type_approx env e
1908
- | Pexp_fun ( p , _ , _ , e , arity ) ->
1908
+ | Pexp_fun { arg_label = p ; rhs = e ; arity} ->
1909
1909
let ty = if is_optional p then type_option (newvar () ) else newvar () in
1910
1910
newty (Tarrow (p, ty, type_approx env e, Cok , arity))
1911
1911
| Pexp_match (_ , {pc_rhs = e } :: _ ) -> type_approx env e
@@ -2363,7 +2363,8 @@ and type_expect_ ?type_clash_context ?in_function ?(recarg = Rejected) env sexp
2363
2363
exp_attributes = sexp.pexp_attributes;
2364
2364
exp_env = env;
2365
2365
}
2366
- | Pexp_fun (l , Some default , spat , sbody , arity ) ->
2366
+ | Pexp_fun
2367
+ {arg_label = l; default = Some default; lhs = spat; rhs = sbody; arity} ->
2367
2368
assert (is_optional l);
2368
2369
(* default allowed only with optional argument *)
2369
2370
let open Ast_helper in
@@ -2403,7 +2404,7 @@ and type_expect_ ?type_clash_context ?in_function ?(recarg = Rejected) env sexp
2403
2404
in
2404
2405
type_function ?in_function ~arity loc sexp.pexp_attributes env ty_expected l
2405
2406
[Exp. case pat body]
2406
- | Pexp_fun ( l , None, spat , sbody , arity ) ->
2407
+ | Pexp_fun { arg_label = l ; default = None ; lhs = spat ; rhs = sbody ; arity} ->
2407
2408
type_function ?in_function ~arity loc sexp.pexp_attributes env ty_expected l
2408
2409
[Ast_helper.Exp. case spat sbody]
2409
2410
| Pexp_apply (sfunct , sargs ) ->
0 commit comments