Author: marek
Date: 2005-10-11 02:49:09 -0400 (Tue, 11 Oct 2005)
New Revision: 51548

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/convert.cs
Log:
2005-10-11  Marek Safar  <[EMAIL PROTECTED]>

        Fix #76370.
        * convert.cs (ExplicitConversionCore): Fixed object->enum
        conversion.

Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2005-10-11 04:37:50 UTC (rev 51547)
+++ trunk/mcs/mcs/ChangeLog     2005-10-11 06:49:09 UTC (rev 51548)
@@ -1,3 +1,9 @@
+2005-10-11  Marek Safar  <[EMAIL PROTECTED]>
+
+       Fix #76370.
+       * convert.cs (ExplicitConversionCore): Fixed object->enum
+       conversion.
+
 2005-10-10  Raja R Harinath  <[EMAIL PROTECTED]>
 
        * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit

Modified: trunk/mcs/mcs/convert.cs
===================================================================
--- trunk/mcs/mcs/convert.cs    2005-10-11 04:37:50 UTC (rev 51547)
+++ trunk/mcs/mcs/convert.cs    2005-10-11 06:49:09 UTC (rev 51548)
@@ -1685,9 +1685,9 @@
                                return ne;
 
                        //
-                       // Unboxing conversion.
+                       // Unboxing conversions; only object types can be 
convertible to enum
                        //
-                       if (expr_type == TypeManager.object_type && 
target_type.IsValueType)
+                       if (expr_type == TypeManager.object_type && 
target_type.IsValueType || expr_type == TypeManager.enum_type)
                                return new UnboxCast (expr, target_type);
 
                        if (TypeManager.IsEnumType (expr_type)) {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to