Author: marek
Date: 2007-11-20 07:52:51 -0500 (Tue, 20 Nov 2007)
New Revision: 89974

Modified:
   branches/mono-1-2-6/mcs/mcs/ChangeLog
   branches/mono-1-2-6/mcs/mcs/convert.cs
Log:
2007-11-20  Marek Safar  <[EMAIL PROTECTED]>

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


Modified: branches/mono-1-2-6/mcs/mcs/ChangeLog
===================================================================
--- branches/mono-1-2-6/mcs/mcs/ChangeLog       2007-11-20 12:50:58 UTC (rev 
89973)
+++ branches/mono-1-2-6/mcs/mcs/ChangeLog       2007-11-20 12:52:51 UTC (rev 
89974)
@@ -1,3 +1,9 @@
+2007-11-20  Marek Safar  <[EMAIL PROTECTED]>
+
+       A fix for regression #342584
+       * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
+       conversion.
+       
 2007-11-19  Marek Safar  <[EMAIL PROTECTED]>
 
        A fix for regression #342512

Modified: branches/mono-1-2-6/mcs/mcs/convert.cs
===================================================================
--- branches/mono-1-2-6/mcs/mcs/convert.cs      2007-11-20 12:50:58 UTC (rev 
89973)
+++ branches/mono-1-2-6/mcs/mcs/convert.cs      2007-11-20 12:52:51 UTC (rev 
89974)
@@ -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