Possible Duplicate:
C# int, Int32 and enum's
C# allows you to set the underlying type of an enumeration to long. But, how would you explain the difference in behavior when you try to compile the following two statements:
public enum Colors : long
{
Blue = 512L,
Purple = 1024L
}
and
public enum Colors : System.Int64
{
Blue = 512L,
Purple = 1024L
}
The first one compiles oK (with : long), while the second (with : System.Int64) wont compile - you get an error: Type byte, sbyte, short, ushort, int, uint, long, or ulong expected Note: Obviously, I understand the error message. What has me baffled is that I thought that "long" is more or less an alias for "Int64"