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

Extensible (polymorphic) variants #72

Open
shayne-fletcher opened this issue Mar 14, 2018 · 0 comments
Open

Extensible (polymorphic) variants #72

shayne-fletcher opened this issue Mar 14, 2018 · 0 comments

Comments

@shayne-fletcher
Copy link

shayne-fletcher commented Mar 14, 2018

This code defeats ppx_deriving_yojson:

     type 't a = [ | `A of 't ]
     type 't ext = [ | 't a | `B of 't ]

The problem seems to lie with the ext_of_yojson function.

Here's the error as shown in utop

utop[2]> type 't ext = [ | 't a | `B of 't ][@@deriving yojson];;
Error: This definition has type
         (Yojson.Safe.json -> 't Ppx_deriving_yojson_runtime.error_or) ->
         Yojson.Safe.json -> 't ext Ppx_deriving_yojson_runtime.error_or
       which is less general than
         't0.
           (Yojson.Safe.json -> 't0 Ppx_deriving_yojson_runtime.error_or) ->
           Yojson.Safe.json -> 't0 ext Ppx_deriving_yojson_runtime.error_or
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant