To my surprise, I get the following statement:
public static IEnumerable AllEnums
=> Enum.GetValues(typeof(SomeType));
to
The general Array
base class is not typed, so it does not implement any type-specific interfaces; however, a vector can be cast directly - and GetValues
actually returns a vector; so:
public static IEnumerable AllEnums
= (SomeType[])Enum.GetValues(typeof(SomeType));
or perhaps simpler:
public static SomeType[] AllEnums
= (SomeType[])Enum.GetValues(typeof(SomeType));