The parser implicitly sets the id of the union child to increment from 0. The scheme above can be translated as:
union DiscoveryPayload {
A = 0,
B = 1,
C = 2,
D = 3,
}
Unfortunately, the current union syntax does not support customizing this id, with the consequence that the generated code cannot be deleted if the preceding child is disambiguated because the id is automatically generated by the parser
From the perspective of real projects, it is relatively common for union subclauses to be deprecated, and it is good for users to support the new syntax for customizing ids
Currently, the scheme of the union type is:
The parser implicitly sets the id of the union child to increment from 0. The scheme above can be translated as:
Unfortunately, the current union syntax does not support customizing this id, with the consequence that the generated code cannot be deleted if the preceding child is disambiguated because the id is automatically generated by the parser
From the perspective of real projects, it is relatively common for union subclauses to be deprecated, and it is good for users to support the new syntax for customizing ids