El s�b, 11-01-2003 a las 21:30, Dan Guidara escribi�: > As far as I understand it, all objects in C# are inherited from class > object. Therefore every single object can be implicited casted to it, > (its the base class). Now, the enum is downcasted to an object then > casted as a Icomparable. It stands to reason that something of type > object can be convert into any of its child types, I am sure that > strange behavior occurs from this sometimes. The second piece of code > is trying to go directly from an Enum to an Icomplarable through an > implicit cast which isnt doable given the type differences. ^^^^^^^^
It's explicit. But if you do: "ic = (IComparable) (Enum) en;" it works (and it's an explicit cast). Also if you print the interfaces of the type (typeof (MyEnum).GetInterfaces ()), it shows IComparable... -Gonzalo _______________________________________________ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
