-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
bs.optional + bs.deriving abstract shows warning 69 #414
Conversation
I'm tempted not to fix this one. It aligns with dune, generally. I tried this in native, and for the following
$ dune build ./scratch.exe
ocamldep .scratch.eobjs/scratch.ml.d
ocamlopt .scratch.eobjs/native/dune__exe__Scratch.{cmx,o} (exit 2)
File "scratch.ml", line 1, characters 0-49:
1 | type config = { leading : bool; trailing : bool }
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error (warning 34 [unused-type-declaration]): unused type config.
File "scratch.ml", line 1, characters 16-31:
1 | type config = { leading : bool; trailing : bool }
^^^^^^^^^^^^^^^
Error (warning 69 [unused-field]): unused record field leading.
File "scratch.ml", line 1, characters 32-47:
1 | type config = { leading : bool; trailing : bool }
^^^^^^^^^^^^^^^
Error (warning 69 [unused-field]): unused record field trailing. |
There are 2 solutions downstream:
Any reason preventing you from doing 1. or 2.? |
I am unsure the issue can be solved by actually using the fields, I see it more related to the way Maybe users can fix the problem by following your recommendations, but I think |
Thanks for clarifying the test and the difference when |
This is, in fact, a problem related to code generated by |
9eb5ce3
to
044c1ff
Compare
044c1ff
to
a5a2bc4
Compare
Thanks! |
CHANGES: - Disable warning 69 (`unused-field` in record) for the private record generated by the `bs.deriving` attribute ([melange-re/melange#414](melange-re/melange#414)) - Disable warning 20 (`ignored-extra-argument`) when applying `foo##fn arg1 arg2` ([melange-re/melange#416](melange-re/melange#416)): - in cases such as `external x : < .. > Js.t = ""`, the typechecker doesn't know the arity of the function, even though Melange will emit an uncurried function call. - Disable warning 61 (`unboxable-type-in-prim-decl`) in `external` declarations ([melange-re/melange#415](melange-re/melange#415)): - Melange externals are substantially different from OCaml externals. This warning doesn't make sense in a JS runtime. - melc: introduce `--bs-module-name` flag to specify the original file name for the current compilation unit ([melange-re/melange#413](melange-re/melange#413)) - Dune's namespacing implementation generates modules such as `lib__Original_name`. Passing `--bs-module-name original_name` allows melange to issue correct `import` / `require` statements to the unmangled JS file names.
@anmonteiro I ran into this issue and thought on sharing it in case it can be fixed on Melange side.
As Melange in Dune is using OCaml byte default flags, and warning 69 was introduced in 4.13.0, these warnings that did not happen with ReScript are raised now on Melange.
Maybe the warning could be silenced at Melange ppx level? In
bs.optional
attrs?