Skip to content

Commit 549a999

Browse files
committed
Prepare for 5.2 AST bump
1 parent 721807d commit 549a999

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: src/ppx_deriving_qcheck/ppx_deriving_qcheck.ml

+8-2
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,15 @@ let pattern_name pat : string =
5757
the actual body using these args. *)
5858
let rec args_and_body expr : (string list * expression) =
5959
match expr.pexp_desc with
60-
| Pexp_fun (Nolabel, _, pat, expr) ->
60+
| Pexp_function (fargs, _constraint, Pfunction_body expr) ->
6161
let (args, body) = args_and_body expr in
62-
(pattern_name pat :: args, body)
62+
let pats =
63+
List.filter_map (function
64+
| { pparam_desc = Pparam_val (Nolabel, _, p); _ } -> Some (pattern_name p)
65+
| _ -> None
66+
) fargs
67+
in
68+
(pats @ args, body)
6369
| _ -> ([], expr)
6470

6571
(** {2. Recursive generators} *)

0 commit comments

Comments
 (0)