Skip to content

Assist proposals: generate .(as|is)_variant() for all variants #11227

@numero-744

Description

@numero-744

Would be a continuation of #7604 (and maybe other issues that I could not find).

It would add the possibility to implement the method for all variants at once. It would be made available here (at $0):

enum My$0Enum {
    FirstVariant,
    OtherVariant,
}

because it would be enum-wise, implementing the method for each relevant enum (no as_ if no data inside) when not implemented yet. Actually, do as if the assist were used manually on each variant, if applicable.

Also, because authors will not know about this feature, and as a suggestion in general, it could be nice to make the assist available where the current assist (for a one-variant generation) is available.

So two assists would be added:

  • Generate is_ methods for all variants
  • Generate as_ methods for all relevant variants

Each assist would be implemented in the same file as the one-variant-wise ones, re-using most of their implementations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-assistsC-featureCategory: feature requestS-actionableSomeone could pick this issue up and work on it right now

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions