Skip to content

[Proposal] 'switch all' enhancement for enums #179

@tpetrina

Description

@tpetrina

When switching on enums, I would like to get a compile time error if I missed a case. Simple usage would be:

enum EnumValues { First, Second, Third }

EnumValues myEnumValue;

switch all (myEnumValue)
{
  case First:
  case Second:
   <--- compile time error if default statement is missing or any other enum value
}

All is obviously optional and only works for enums.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions