Skip to content

Commit d305fbe

Browse files
author
Christoph Höger
committed
Fix 4.02.3 compatibility
Signed-off-by: Christoph Höger <[email protected]>
1 parent d413b1f commit d305fbe

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/ppx_deriving_folder.cppo.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ let process_decl quoter fold_arg_t
239239
(* Get a pattern and a corresponding folding-sequence from the constructor args *)
240240
let (pat, folds) = match pcd_args with
241241
(* Classic constructor arguments, we make up names *)
242-
Pcstr_tuple typs ->
242+
Pcstr_tuple(typs) ->
243243
let appls = List.map (expr_of_typ names quoter) typs in
244244
(pat_tuple (opt_pattn appls), List.combine (varn typs) appls)
245245
#if OCAML_VERSION >= (4, 03, 0)
@@ -272,7 +272,7 @@ let process_decl quoter fold_arg_t
272272
constrs |>
273273
List.map (fun { pcd_name; pcd_args} ->
274274
let (pat, vars) = match pcd_args with
275-
Pcstr_tuple typs -> (pconstr pcd_name.txt (pattn typs), varn typs)
275+
Pcstr_tuple(typs) -> (pconstr pcd_name.txt (pattn typs), varn typs)
276276
#if OCAML_VERSION >= (4, 03, 0)
277277
| Pcstr_record labels ->
278278
(pconstrrec pcd_name.txt (pattl labels),
@@ -323,7 +323,7 @@ let process_decl quoter fold_arg_t
323323
let typs_to_field { pcd_name; pcd_args} =
324324
let typs =
325325
match pcd_args with
326-
Pcstr_tuple typs -> typs
326+
Pcstr_tuple(typs) -> typs
327327
#if OCAML_VERSION >= (4, 03, 0)
328328
| Pcstr_record labels -> List.map (fun {pld_type} -> pld_type) labels
329329
#endif

src/ppx_deriving_mapper.cppo.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ let rec expr_of_typ names quoter typ =
207207
Some (Exp.ident (mknoloc (Lident ("poly_" ^ x))))
208208

209209
(* A tuple, map each element *)
210-
| { ptyp_desc = Ptyp_tuple typs } ->
210+
| { ptyp_desc = Ptyp_tuple(typs) } ->
211211
let maps = List.map expr_of_typ typs in
212212
let pat = pat_tuple (pattn maps) in
213213
let map = match reduce_map_seq (List.combine (varn typs) maps) with
@@ -254,7 +254,7 @@ let process_decl quoter
254254
constrs |>
255255
List.map (fun { pcd_name; pcd_args } ->
256256
let (pat, rhs) = match pcd_args with
257-
Pcstr_tuple typs ->
257+
Pcstr_tuple(typs) ->
258258
let maps = List.map (expr_of_typ names quoter) typs in
259259
(pat_tuple (pattn maps), constr pcd_name.txt (reduce_map_seq (List.combine (varn typs) maps)))
260260
#if OCAML_VERSION >= (4, 03, 0)
@@ -281,7 +281,7 @@ let process_decl quoter
281281
List.map (fun { pcd_name; pcd_args } ->
282282
let subfield = Ppx_deriving.mangle_lid (`Prefix "map") (Lident pcd_name.txt) in
283283
let (pat, mk) = match pcd_args with
284-
Pcstr_tuple typs -> ((pconstr pcd_name.txt (pattn typs)), tuple (varn typs))
284+
Pcstr_tuple(typs) -> ((pconstr pcd_name.txt (pattn typs)), tuple (varn typs))
285285
#if OCAML_VERSION >= (4, 03, 0)
286286
| Pcstr_record labels ->
287287
(pconstrrec pcd_name.txt (pattl labels),
@@ -348,7 +348,7 @@ let process_decl quoter
348348
let typs_to_field { pcd_name; pcd_args} =
349349
let typs =
350350
match pcd_args with
351-
Pcstr_tuple typs -> typs
351+
Pcstr_tuple(typs) -> typs
352352
#if OCAML_VERSION >= (4, 03, 0)
353353
| Pcstr_record labels -> List.map (fun {pld_type} -> pld_type) labels
354354
#endif

0 commit comments

Comments
 (0)