There are various ways to achieve this goal:
return typeof(Enum).IsAssignableFrom(t) && t != typeof(Enum);
or
return typeof(Enum).IsAssignableFrom(t) && t.IsValueType;
or (now that I saw it exists by checking IsValueType )
return t.IsEnum;
Obviously, the latter is the best approach, but the first two will tell you how to handle such situations.
source share