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

[@defaut <value>] seems broken #14

Open
toots opened this issue Aug 2, 2022 · 0 comments
Open

[@defaut <value>] seems broken #14

toots opened this issue Aug 2, 2022 · 0 comments
Labels
forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system.

Comments

@toots
Copy link

toots commented Aug 2, 2022

Test:

type foo = {
  bar : string;
  foo : (int [@default 123]);
} [@@deriving yojson]

let () =
  try
    ignore(foo_of_yojson (Yojson.Safe.from_string {|{"bar":"baz"}|}))
  with
    | Ppx_yojson_conv_lib.Yojson_conv.Of_yojson_error (exn, _) ->
        Printf.printf "Error: %s\n%!" (Printexc.to_string exn);
        exit 1

Result:

Error: Failure("test.ml.foo_of_yojson: the following record elements were undefined: foo")
@github-iron github-iron added the forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system. label Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system.
Projects
None yet
Development

No branches or pull requests

2 participants