Author: martin
Date: 2006-03-06 20:02:09 -0500 (Mon, 06 Mar 2006)
New Revision: 57641

Added:
   branches/mono-1-1-13/mcs/tests/gtest-251.cs
Modified:
   branches/mono-1-1-13/mcs/gmcs/ChangeLog
   branches/mono-1-1-13/mcs/gmcs/generic.cs
Log:
**** Merged r57639 from MCS ****

Modified: branches/mono-1-1-13/mcs/gmcs/ChangeLog
===================================================================
--- branches/mono-1-1-13/mcs/gmcs/ChangeLog     2006-03-07 01:00:28 UTC (rev 
57640)
+++ branches/mono-1-1-13/mcs/gmcs/ChangeLog     2006-03-07 01:02:09 UTC (rev 
57641)
@@ -1,3 +1,8 @@
+2006-03-07  Martin Baulig  <[EMAIL PROTECTED]>
+
+       * generic.cs (TypeManager.InferType): Allow infering
+       `IEnumerable<T>' with an array of T; see gtest-251.cs.
+
 2006-03-06  Martin Baulig  <[EMAIL PROTECTED]>
 
        * generic.cs

Modified: branches/mono-1-1-13/mcs/gmcs/generic.cs
===================================================================
--- branches/mono-1-1-13/mcs/gmcs/generic.cs    2006-03-07 01:00:28 UTC (rev 
57640)
+++ branches/mono-1-1-13/mcs/gmcs/generic.cs    2006-03-07 01:02:09 UTC (rev 
57641)
@@ -2375,11 +2375,19 @@
                        }
 
                        if (at.IsArray) {
-                               if (!pt.IsArray ||
-                                   (at.GetArrayRank () != pt.GetArrayRank ()))
-                                       return false;
+                               if (pt.IsArray) {
+                                       if (at.GetArrayRank () != 
pt.GetArrayRank ())
+                                               return false;
 
-                               return InferType (pt.GetElementType (), 
at.GetElementType (), infered);
+                                       return InferType (pt.GetElementType (), 
at.GetElementType (), infered);
+                               }
+
+                               if (!pt.IsGenericType ||
+                                   (pt.GetGenericTypeDefinition () != 
generic_ienumerable_type))
+                                   return false;
+
+                               Type[] args = GetTypeArguments (pt);
+                               return InferType (args [0], at.GetElementType 
(), infered);
                        }
 
                        if (pt.IsArray) {

Copied: branches/mono-1-1-13/mcs/tests/gtest-251.cs (from rev 57639, 
trunk/mcs/tests/gtest-251.cs)

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

Reply via email to