Skip to content

Commit

Permalink
missing case in post deriver
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtori committed Dec 13, 2024
1 parent 0ce3bb5 commit 013feb7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/ppx/ppx_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1103,8 +1103,14 @@ let deriver_str_gen kind meth ~loc ~path:_ (rec_flag, l) path input output error
[%expr EzAPI.Json [%e evar ~loc (t.ptype_name.txt ^ "_enc")]],
(Option.value ~default:t.ptype_name.txt name)
| _, t :: _ ->
[%expr EzAPI.Json [%e evar ~loc (t.ptype_name.txt ^ "_enc")]],
Option.fold ~none:options.output ~some:aux output,
let input, output = match input, output with
| Some input, Some output -> aux input, aux output
| Some input, _ -> aux input, [%expr EzAPI.Json [%e evar ~loc (t.ptype_name.txt ^ "_enc")]]
| _, Some output -> [%expr EzAPI.Json [%e evar ~loc (t.ptype_name.txt ^ "_enc")]], aux output
| _ ->
[%expr EzAPI.Json [%e evar ~loc (t.ptype_name.txt ^ "_enc")]],
Option.fold ~none:options.output ~some:aux output in
input, output,
(Option.value ~default:t.ptype_name.txt name)
| _ ->
Option.fold ~none:options.input ~some:aux input,
Expand Down

0 comments on commit 013feb7

Please sign in to comment.