Author: martin
Date: 2005-03-22 15:08:30 -0500 (Tue, 22 Mar 2005)
New Revision: 42125

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

        * decl.cs (MemberCache.DeepCopy): Manually copy the entries and
        clear the `BindingFlags.DeclaredOnly'.
        (MemberCache.AddMethods): Add `BindingFlags.DeclaredOnly'.



Modified: trunk/mcs/gmcs/ChangeLog
===================================================================
--- trunk/mcs/gmcs/ChangeLog    2005-03-22 18:42:55 UTC (rev 42124)
+++ trunk/mcs/gmcs/ChangeLog    2005-03-22 20:08:30 UTC (rev 42125)
@@ -1,9 +1,8 @@
 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.
+       * decl.cs (MemberCache.DeepCopy): Manually copy the entries and
+       clear the `BindingFlags.DeclaredOnly'.
+       (MemberCache.AddMethods): Add `BindingFlags.DeclaredOnly'.
 
 2005-03-22  Martin Baulig  <[EMAIL PROTECTED]>
 

Modified: trunk/mcs/gmcs/decl.cs
===================================================================
--- trunk/mcs/gmcs/decl.cs      2005-03-22 18:42:55 UTC (rev 42124)
+++ trunk/mcs/gmcs/decl.cs      2005-03-22 20:08:30 UTC (rev 42125)
@@ -1813,9 +1813,15 @@
 
                        IDictionaryEnumerator it = other.GetEnumerator ();
                        while (it.MoveNext ()) {
-                               hash [it.Key] = ((ArrayList) it.Value).Clone ();
-                        }
-                                
+                               ArrayList old_list = (ArrayList) it.Value;
+                               ArrayList new_list = new ArrayList ();
+
+                               foreach (CacheEntry entry in old_list)
+                                       new_list.Add (new CacheEntry (entry));
+
+                               hash [it.Key] = new_list;
+                       }
+
                        return hash;
                }
 
@@ -1926,7 +1932,7 @@
                        // When processing 'Y', the method_cache will already 
have a copy of 'f', 
                        // with ReflectedType == X.  However, we want to ensure 
that its ReflectedType == Y
                        // 
-                       MethodBase [] members = type.GetMethods (bf);
+                       MethodBase [] members = type.GetMethods (bf | 
BindingFlags.DeclaredOnly);
 
                        Array.Reverse (members);
 
@@ -1945,6 +1951,7 @@
                                BindingFlags new_bf = bf;
                                if (member.DeclaringType == type)
                                        new_bf |= BindingFlags.DeclaredOnly;
+
                                list.Add (new CacheEntry (Container, member, 
MemberTypes.Method, new_bf));
                        }
                }
@@ -2047,11 +2054,11 @@
                                this.EntryType = GetEntryType (mt, bf);
                        }
 
-                       public CacheEntry (CacheEntry other, MemberInfo update)
+                       public CacheEntry (CacheEntry other)
                        {
                                this.Container = other.Container;
                                this.EntryType = other.EntryType & 
~EntryType.Declared;
-                               this.Member = update;
+                               this.Member = other.Member;
                        }
 
                        public override string ToString ()

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

Reply via email to