janestreet / ppx_yojson_conv

[@@deriving] plugin to generate Yojson conversion functions
MIT License
58 stars 8 forks source link

Blanket open! triggers warning 66 on OCaml 4.08 #1

Closed MattWindsor91 closed 5 years ago

MattWindsor91 commented 5 years ago

When referencing ppx_yojson_conv in an existing project, I get several warnings of the form:

File "lib/litmus/src/postcondition.ml", line 12, characters 0-0:
Error (warning 66): unused open! Ppx_yojson_conv_lib.Yojson_conv.Primitives.

This would seem to be caused by ppx_yojson_conv inserting the open! into every .ml file, not just the ones that are deriving yojson. (The files that are triggering this warning don't.) This seems a little extreme, and triggers the new OCaml 4.08 warning over unused open!.

I don't get the same issues with any runtimes added by ppx_jane (eg the s-expression converter, which I figure must be ppx_sexp_conv, which'll introduce Sexplib0 and/or Parsexp opens I guess?)—are they doing something different?

hhugo commented 5 years ago

Warning 66 is not supposed to be enable by default. How do you compile you program ? might be related to https://github.com/ocaml/dune/issues/2410

MattWindsor91 commented 5 years ago

It will be, yeah, since I'm using dune, lang 1.10. Thanks!

hhugo commented 5 years ago

Dune 1.11 has been released and should fix this issue.