Author: raja
Date: 2005-06-21 03:23:14 -0400 (Tue, 21 Jun 2005)
New Revision: 46284

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/convert.cs
Log:
* convert.cs (FindMostEncompassedType): Add two trivial special
cases (number_of_types == 0 || number_of_types == 1).
(FindMostEncompasingType): Likewise.


Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2005-06-21 07:17:50 UTC (rev 46283)
+++ trunk/mcs/mcs/ChangeLog     2005-06-21 07:23:14 UTC (rev 46284)
@@ -1,3 +1,9 @@
+2005-06-21  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       * convert.cs (FindMostEncompassedType): Add two trivial special
+       cases (number_of_types == 0 || number_of_types == 1).
+       (FindMostEncompasingType): Likewise.
+
 2005-06-17  Raja R Harinath  <[EMAIL PROTECTED]>
 
        Some cleanups preparing for the fix of #75283.

Modified: trunk/mcs/mcs/convert.cs
===================================================================
--- trunk/mcs/mcs/convert.cs    2005-06-21 07:17:50 UTC (rev 46283)
+++ trunk/mcs/mcs/convert.cs    2005-06-21 07:23:14 UTC (rev 46284)
@@ -704,6 +704,12 @@
                {
                        Type best = null;
 
+                       if (types.Count == 0)
+                               return null;
+
+                       if (types.Count == 1)
+                               return (Type) types [0];
+
                        EmptyExpression expr = EmptyExpression.Grab ();
 
                        foreach (Type t in types) {
@@ -740,6 +746,12 @@
                {
                        Type best = null;
 
+                       if (types.Count == 0)
+                               return null;
+
+                       if (types.Count == 1)
+                               return (Type) types [0];
+
                        EmptyExpression expr = EmptyExpression.Grab ();
 
                        foreach (Type t in types) {

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

Reply via email to