-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Labels
cat:langCategory: Language designCategory: Language designcmp:compilerComponent: Compiler backend (e.g., annotation processors, code generators)Component: Compiler backend (e.g., annotation processors, code generators)cmp:runtimeComponent: Target runtimesComponent: Target runtimestyp:enhanceType: Enhancement/new featureType: Enhancement/new feature
Milestone
Description
If union types can set its default tag it would help backward compatibility e.g.:
record name (text fullname);
// The below record type can be migrated to the above union type:
// Pseudo code — syntax is just for example
union name
= wastern-name (text first-name, text? middle-name, text last-name)
| east-asian-name (text family-name, text given-name)
| default culture-agnostice-name (text fullname)
;
The default tag is implicitly determined if the JSON object doesn’t have "_tag" field, which means the case a record type is refactored to a union type.
- Add
defaultkeyword. (Optional default tag for union type #227) - Write section about
defaultinto docs/refactoring.md.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
cat:langCategory: Language designCategory: Language designcmp:compilerComponent: Compiler backend (e.g., annotation processors, code generators)Component: Compiler backend (e.g., annotation processors, code generators)cmp:runtimeComponent: Target runtimesComponent: Target runtimestyp:enhanceType: Enhancement/new featureType: Enhancement/new feature