Author: marek
Date: 2007-11-20 07:49:27 -0500 (Tue, 20 Nov 2007)
New Revision: 89972

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

        A fix for bug #342584
        * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
        conversion.
        


Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2007-11-20 12:45:11 UTC (rev 89971)
+++ trunk/mcs/mcs/ChangeLog     2007-11-20 12:49:27 UTC (rev 89972)
@@ -1,3 +1,9 @@
+2007-11-20  Marek Safar  <[EMAIL PROTECTED]>
+
+       A fix for bug #342584
+       * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
+       conversion.
+       
 2007-11-19  Marek Safar  <[EMAIL PROTECTED]>
 
        A fix for bug #342512

Modified: trunk/mcs/mcs/convert.cs
===================================================================
--- trunk/mcs/mcs/convert.cs    2007-11-20 12:45:11 UTC (rev 89971)
+++ trunk/mcs/mcs/convert.cs    2007-11-20 12:49:27 UTC (rev 89972)
@@ -1977,6 +1977,17 @@
                                Expression ce = ExplicitConversionCore (ec, 
expr, TypeManager.EnumToUnderlying (target_type), loc);
                                if (ce != null)
                                        return EmptyCast.Create (ce, 
target_type);
+                               
+                               //
+                               // LAMESPEC: IntPtr and UIntPtr conversion to 
any Enum is allowed
+                               //
+                if (expr_type == TypeManager.intptr_type || expr_type == 
TypeManager.uintptr_type) {
+                                       ne = ExplicitUserConversion (ec, expr, 
TypeManager.EnumToUnderlying (target_type), loc);
+                                       if (ne != null)
+                                               return ExplicitConversionCore 
(ec, ne, target_type, loc);
+                }
+                               
+                               return null;
                        }
 
                        ne = ExplicitNumericConversion (expr, target_type);

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

Reply via email to