reason
reason copied to clipboard
Invalid code generated from valid OCaml interface code
Input (interface file):
val foo: int
[@@a val bar: string [@@b]]
Output:
[@a [@b] external bar: string = ]
let foo: int;
I believe the output should be:
[@a [@b] let bar: string; ]
let foo: int;
Version: Reason 3.5.0 @ 8ee1ff66
I think this is a duplicate of https://github.com/facebook/reason/issues/2430, although a better / more minimal repro.
@anmonteiro Ah yeah, it definitely is, I was also using gen_js_api 😄 Feel free to close it as duplicate 👍
I ended up coding my bindings in pure ocaml due to this issue, and the fact that gen_js_api does not support reason natively and additional rules with reftm were awkward.
and the fact that gen_js_api does not support reason natively
@Lupus The gen_js_api ppx should work out of the box, no? For the binary applied to interface files, I ended up finding a dune rule that works fine.
The only stopper for Reason syntax in gen_js_api that I can see at the moment is this issue :)
Neat! My dune-fu is not so strong, I'll leverage this approach once the issue is fixed :)