-
Notifications
You must be signed in to change notification settings - Fork 304
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
Missing discriminator field when using TypeScriptTaggedUnion #3837
Comments
Just checked some other examples and found that adding a label to the Fable/src/Fable.Transforms/FSharp2Fable.fs Lines 77 to 85 in e2285d6
I also notice now that the labels on |
Description
When creating an enum value from a TypeScriptTaggedUnion, the type field doesn't get added if a case has a single argument.
Repro code
https://fable.io/repl/#?code=PYBwpgdgBAYghgIwDZgHQGFgCcwFgBQBA2gDwAqAnuAMoDGWAliAC5lwDm7YAJgKoQNgEABQAiZlTCiAlAD4AugQngoAQQCuzABbVmcZmCgBeAgB8oALTBZgZqAHkIh4ADMoAZ2aMI7O2QDuwFCuHl4MPlAAVKHevoT4KMxQAF7WQUZqmjp6BqhWNgSJwU7Gmdq6+miOhqJwooVgScyBpRrlOWgBQWJ1ADRQoggyBA1JtFpgtADWpS7qELTMgtAEUFDm+UEAtLIDqTb1+Gvm1VAA+lA7A0JSq+tQXeeXu+KBokA&html=Q&css=Q
Expected and actual results
The
One
case gets compiled to the raw value, without the discriminator field "type", while the pattern match is checking for a field that will never be present:I would expect it to look similar to
Two
:Related information
The text was updated successfully, but these errors were encountered: