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
When using a @tag
variant type with an inline record definition, we lose the error calling out a duplicate tag: "This untagged variant definition is invalid: Duplicate literal foo."
Here's an example with a boolean tag but this also does not produce the compiler error for ints / strings in the playground link
@tag("type")
type ex =
| @as(true) True({data: string})
| @as(false) False({data: unit})
| @as(false) Third({data: unit, foo: string})
let parse = value => switch value {
| True({data}) => Console.log(data)
| False(_) => Console.log("false")
| Third({foo}) => Console.log2("foo: ", foo)
}
Metadata
Metadata
Assignees
Labels
No labels