Skip to content

Optional default tag for union types #13

@dahlia

Description

@dahlia

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cat:langCategory: Language designcmp:compilerComponent: Compiler backend (e.g., annotation processors, code generators)cmp:runtimeComponent: Target runtimestyp:enhanceType: Enhancement/new feature

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions