Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ppxlib >= 0.14.0 #127

Merged
merged 1 commit into from
Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ppx_deriving_yojson.opam
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ depends: [
"dune" {>= "1.0"}
"yojson" {>= "1.6.0" & < "2.0.0"}
"result"
"ppx_deriving" {>= "5.0"}
"ppxlib" {>= "0.9.0" & < "0.14.0"}
"ppx_deriving" {>= "5.1"}
"ppxlib" {>= "0.14.0"}
"ounit" {with-test & >= "2.0.0"}
]
synopsis:
Expand Down
4 changes: 2 additions & 2 deletions src/ppx_deriving_yojson.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let disable_warning_39 () =
Ast_helper.Attr.mk ~loc name (PStr [%str "-39"])


let mod_mknoloc x = mknoloc x
let mod_mknoloc x = mknoloc (Some x)

let deriver = "yojson"
let raise_errorf = Ppx_deriving.raise_errorf
Expand Down Expand Up @@ -364,7 +364,7 @@ let ser_str_of_type ~options ~path ({ ptype_loc = loc } as type_decl) =
let ty = Typ.poly poly_vars (polymorphize_ser [%type: [%t typ] -> Yojson.Safe.t]) in
let default_fun =
let type_path = String.concat "." (path @ [type_decl.ptype_name.txt]) in
let e_type_path = Exp.constant (Pconst_string (type_path, None)) in
let e_type_path = Ast_builder.Default.estring ~loc:Location.none type_path in
[%expr fun _ ->
invalid_arg ("to_yojson: Maybe a [@@deriving yojson] is missing when extending the type "^
[%e e_type_path])]
Expand Down