-
Notifications
You must be signed in to change notification settings - Fork 463
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
bug(genType): @genType @as("0")
generates type 0
not "0"
#6486
Comments
cristianoc
added a commit
that referenced
this issue
Nov 20, 2023
There is some special code in the type emitter to take care of poly variants of the form e.g. `#0`, which is represented internally as the string "0". This conflicts with normal variants annotated with `@as("0")` and such. This PR resolves the case of numeric poly variants early on, and removes the special casing in the code emitter. Fixes #6486
cristianoc
added a commit
that referenced
this issue
Nov 20, 2023
There is some special code in the type emitter to take care of poly variants of the form e.g. `#0`, which is represented internally as the string "0". This conflicts with normal variants annotated with `@as("0")` and such. This PR resolves the case of numeric poly variants early on, and removes the special casing in the code emitter. Fixes #6486
Good catch. |
cristianoc
added a commit
that referenced
this issue
Nov 21, 2023
There is some special code in the type emitter to take care of poly variants of the form e.g. `#0`, which is represented internally as the string "0". This conflicts with normal variants annotated with `@as("0")` and such. This PR resolves the case of numeric poly variants early on, and removes the special casing in the code emitter. Fixes #6486
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for filing! Check list:
Hi there! I'm try to using variant interop with ReScript v11-rc.5. here is some snippet from my codes:
And generated js code is fine as hopefully as what I expected
I expect above code should be generate
"0" | "1"
as string union type, but actually I got0 | 1
as numeric union type.The text was updated successfully, but these errors were encountered: