Closed
Description
Thank you for filing! Check list:
- Is it a bug? Usage questions should often be asked in the forum instead.
- Concise, focused, friendly issue title & description.
- A minimal, reproducible example.
- OS and browser versions, if relevant.
- Is it already fixed in master? Instructions
Hi there! I'm try to using variant interop with ReScript v11-rc.5. here is some snippet from my codes:
@genType
type tabIndex = | @as("0") Activity | @as("1") UserKeyword
And generated js code is fine as hopefully as what I expected
var match$1 = searchParams.get("tabIndex");
var tabIndex;
if (match$1 == null) {
tabIndex = undefined;
} else {
switch (match$1) {
case "0" :
tabIndex = "0";
break;
case "1" :
tabIndex = "1";
break;
default:
tabIndex = undefined;
}
}
I expect above code should be generate "0" | "1"
as string union type, but actually I got 0 | 1
as numeric union type.
export type tabIndex = 0 | 1;
Metadata
Metadata
Assignees
Labels
No labels