Skip to content

Allow customization of generated enum/property name #2

@nevillco

Description

@nevillco

The macro in the example generates:

enum StaticMemberSwitchable {
    case foo
    case bar
    case baz
}
var switchable: StaticMemberSwitchable {
    switch id {
        case Self.foo.id: return .foo
        case Self.bar.id: return .bar
        case Self.baz.id: return .baz
        default: fatalError()
    }
}

I haven't looked whether we can allow the caller to customize the names of enum StaticMemberSwitchable or var switchable, but if possible, it would be nice to help callers avoid naming collisions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions