On System.Enum and System.ValueType

Yup Shawn
has it pretty much right
on
. Both System.Enum and
System.ValueType are themselves reference types. We added them to the system for
two primary reasons:"urn:schemas-microsoft-com:office:office" />

1. We wanted to provide developers an easy way to group all ValueTypes
and all Enums in a class hierarchy.

2. We wanted to specialize the implementation of Equals and GetHashCode()
to be better quality (have less collisions) than was possible on
System.Object

The runtime does not use the base
classes of a type to determine if they are value or reference types. Instead it uses the metadata notations
/>Shawn points out.

As far
as the C# compiler… yup, looks like a bug.
Notice I can do:

IComparable c =
(IComparable) (Enum) Color.Red ;

But,
this gives a compiler error

IComparable c =
(IComparable) Color.Red ;

I asked
the guys on the C# design team about this and I am told it is fixed in the
latest build of “Whidbey”... (There is always the next version you
know).