Skip to content

Commit 51a305e

Browse files
committed
Use Typ.arrows after the refactoring of arrow types.
1 parent dffc266 commit 51a305e

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

compiler/frontend/ast_core_type.ml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,7 @@ let get_curry_arity (ty : t) =
132132
let is_arity_one ty = get_curry_arity ty = 1
133133

134134
let mk_fn_type ~loc (new_arg_types_ty : Parsetree.arg list) (result : t) : t =
135-
let t =
136-
Ext_list.fold_right new_arg_types_ty result (fun {lbl; typ; attrs} acc ->
137-
Ast_helper.Typ.arrow ~loc ~attrs ~arity:None {attrs = []; lbl; typ} acc)
138-
in
139-
match t.ptyp_desc with
140-
| Ptyp_arrow arr ->
141-
let arity = List.length new_arg_types_ty in
142-
{t with ptyp_desc = Ptyp_arrow {arr with arity = Some arity}}
143-
| _ -> t
135+
Typ.arrows ~loc new_arg_types_ty result
144136

145137
let list_of_arrow (ty : t) : t * Parsetree.arg list =
146138
let rec aux (ty : t) acc =

0 commit comments

Comments
 (0)