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

Enum mapping giving 'Sum types without js.* attribute not supported in this context' #81

Closed
nickbetteridge opened this issue Nov 15, 2018 · 1 comment

Comments

@nickbetteridge
Copy link

nickbetteridge commented Nov 15, 2018

I've suddenly run into issues with enums -

Given a file with one line containing type t = [`foo | `bar [@js 42] | `Baz] [@@js.enum], when I run ocamlfind gen_js_api/gen_js_api test.mli I get Error: Sum types without js.* attribute not supported in this context.

I'm pretty sure this was working in the not too distant past - I'm running with ocaml 4.07.0, opam2 and gen_js_api 1.0.5 - gen_js_api is compiling without error on everything else I have.

@nickbetteridge
Copy link
Author

Ah - it's a matter of ampersands - polymorphic variants require just one ampersand - [@js.enum] whereas normal variants require two - [@@js.enum]

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