Author: martin
Date: 2005-03-22 10:32:20 -0500 (Tue, 22 Mar 2005)
New Revision: 42116

Modified:
   trunk/mcs/gmcs/ChangeLog
   trunk/mcs/gmcs/decl.cs
Log:
2005-03-22  Martin Baulig  <[EMAIL PROTECTED]>

        * decl.cs (MemberCache.AddMethods): Reverted Hari's change from
        r40402 in this method: in the generics-land, we cannot compare the
        MethodInfo.MethodHandle's since we may be dealing with
        instantiated method.



Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-03-22 15:28:38 UTC (rev 42115)
+++ trunk/mcs/gmcs/ChangeLog    2005-03-22 15:32:20 UTC (rev 42116)
@@ -1,5 +1,12 @@
 2005-03-22  Martin Baulig  <[EMAIL PROTECTED]>
 
+       * decl.cs (MemberCache.AddMethods): Reverted Hari's change from
+       r40402 in this method: in the generics-land, we cannot compare the
+       MethodInfo.MethodHandle's since we may be dealing with
+       instantiated method.
+
+2005-03-22  Martin Baulig  <[EMAIL PROTECTED]>
+
        * delegate.cs (Delegate.VerifyMethod): Call
        TypeManager.GetParameterData() after method inference, not before.
 

Modified: trunk/mcs/gmcs/decl.cs
===================================================================
--- trunk/mcs/gmcs/decl.cs      2005-03-22 15:28:38 UTC (rev 42115)
+++ trunk/mcs/gmcs/decl.cs      2005-03-22 15:32:20 UTC (rev 42116)
@@ -1940,26 +1940,12 @@
                                        method_hash.Add (name, list);
                                }
 
-                               Type declaring_type = member.DeclaringType;
-                               if (declaring_type == type) {
-                                       list.Add (new CacheEntry (Container, 
member, MemberTypes.Method, bf | BindingFlags.DeclaredOnly));
-                                       continue;
-                               }
-
-                               int n = list.Count;
-                               while (n-- > 0) {
-                                       CacheEntry entry = (CacheEntry) list 
[n];
-                                       MethodBase old = entry.Member as 
MethodBase;
-
-                                       if (member.MethodHandle.Value == 
old.MethodHandle.Value && 
-                                           declaring_type == 
old.DeclaringType) {
-                                               list [n] = new CacheEntry 
(entry, member);
-                                               break;
-                                       }
-                               }
-
-                               if (n < 0)
-                                       throw new InternalErrorException 
("cannot find inherited member " + member + " in base classes of " + type);
+                               // Unfortunately, the elements returned by 
Type.GetMethods() aren't
+                               // sorted so we need to do this check for every 
member.
+                               BindingFlags new_bf = bf;
+                               if (member.DeclaringType == type)
+                                       new_bf |= BindingFlags.DeclaredOnly;
+                               list.Add (new CacheEntry (Container, member, 
MemberTypes.Method, new_bf));
                        }
                }
 

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

Reply via email to