using System.Collections.Generic;
public static List<T> SArrayEnumToList<T>(int[] arr)where T : struct, IConvertible
throw new ArgumentException("T must be of type System.Enum");
return arr.Cast<object>().Cast<T>().ToList();
public static void Main()
var values = new int[]{0, 1, 2};
var results = SArrayEnumToList<Test>(values);
foreach (var result in results)
Console.WriteLine(result);
Test[] foos = (Test[])(object)values;
foreach (var foo in foos)