2003-07-20 Miguel de Icaza <miguel@ximian.com>
authorMiguel de Icaza <miguel@gnome.org>
Sun, 20 Jul 2003 16:29:42 +0000 (16:29 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Sun, 20 Jul 2003 16:29:42 +0000 (16:29 -0000)
* typemanager.cs (LookupTypeReflection): Never expose types which
are NotPublic, NestedPrivate, NestedAssembly, or
NestedFamANDAssem.  We used to return these, and later do a check
that would report a meaningful error, but the problem is that we
would not get the real match, if there was a name override.

svn path=/trunk/mcs/; revision=16444

mcs/mcs/ChangeLog
mcs/mcs/typemanager.cs

index 899a2f6cdbaa5c471cb370fc32d22b8cad8be93e..c7c6ae959b94a52f0e64d4b8f336467e3bc26516 100755 (executable)
@@ -1,3 +1,11 @@
+2003-07-20  Miguel de Icaza  <miguel@ximian.com>
+
+       * typemanager.cs (LookupTypeReflection): Never expose types which
+       are NotPublic, NestedPrivate, NestedAssembly, or
+       NestedFamANDAssem.  We used to return these, and later do a check
+       that would report a meaningful error, but the problem is that we
+       would not get the real match, if there was a name override.
+
 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
 
        * namespace.cs (Namespace, Name): Do not compute the namespace
index 245967b907dac1f8d4aee301de15a7d23681f7d7..afbfb7dbfd0313629e7b5d1b964587268b23e85a 100755 (executable)
@@ -566,7 +566,13 @@ public class TypeManager {
                        t = a.GetType (name);
                        if (t == null)
                                continue;
-                               
+
+                       TypeAttributes ta = t.Attributes & TypeAttributes.VisibilityMask;
+                       if (ta == TypeAttributes.NotPublic ||
+                           ta == TypeAttributes.NestedPrivate ||
+                           ta == TypeAttributes.NestedAssembly ||
+                           ta == TypeAttributes.NestedFamANDAssem)
+                               continue;
                        return t;
                }