Updated fix to work with the new changes from Martin
authorMiguel de Icaza <miguel@gnome.org>
Mon, 7 Jul 2003 21:14:30 +0000 (21:14 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Mon, 7 Jul 2003 21:14:30 +0000 (21:14 -0000)
2003-07-07  Miguel de Icaza  <miguel@ximian.com>

* decl.cs (DeclSpace.FindType): CheckAccessLevel on the type as
well.  Sorry, this fixes the bug Gonzalo tried to fix.

* rootcontext.cs (NamespaceLookup): Accept a DeclSpace, so we can
call the CheckAccessLevel routine.  Only use types that pass the
CheckAccessLevel

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

mcs/mcs/ChangeLog
mcs/mcs/decl.cs
mcs/mcs/rootcontext.cs

index ab7cacdb5c5c7b9a5d986f0daefcf1dc3922b45c..284428a6ea2cb3aaa931d49d5ed699614d9d6525 100755 (executable)
 
 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
 
+       * decl.cs (DeclSpace.FindType): CheckAccessLevel on the type as
+       well.  Sorry, this fixes the bug Gonzalo tried to fix.
+
+       * rootcontext.cs (NamespaceLookup): Accept a DeclSpace, so we can
+       call the CheckAccessLevel routine.  Only use types that pass the
+       CheckAccessLevel 
+
        * typemanager.cs: Reverted patch from Gonzalo, my previous patch
        already fixed it.  
 
index d30ecce902ea1048cac64ab0b676eec2374a50f2..93bc366839717d31ee17928d406e0e8c43444ce7 100755 (executable)
@@ -721,7 +721,7 @@ namespace Mono.CSharp {
                                        if (error)
                                                return null;
 
-                                       if (match != null){
+                                       if (match != null && CheckAccessLevel (match)){
                                                if (t != null){
                                                        Error_AmbiguousTypeReference (loc, name, t, match);
                                                        return null;
index 8cca3ed46c42f845a1b9ac42c0b3b86458e0d653..ba75ec64ec6b8dd4a88f3568cd45ba440a61a56d 100755 (executable)
@@ -459,8 +459,9 @@ namespace Mono.CSharp {
                        return ns.Substring (0, i);
                }
 
-               static Type NamespaceLookup (NamespaceEntry curr_ns, string name, Location loc)
+               static Type NamespaceLookup (DeclSpace ds, string name, Location loc)
                {
+                       NamespaceEntry curr_ns = ds.Namespace;
                        Type t;
 
                        //
@@ -510,7 +511,7 @@ namespace Mono.CSharp {
                                foreach (Namespace using_ns in ns.GetUsingTable ()) {
                                        string full_name = DeclSpace.MakeFQN (using_ns.Name, name);
                                        match = TypeManager.LookupType (full_name);
-                                       if (match != null){
+                                       if (match != null && ds.CheckAccessLevel (match)){
                                                if (t != null){
                                                        DeclSpace.Error_AmbiguousTypeReference (loc, name, t, match);
                                                        return null;
@@ -582,7 +583,7 @@ namespace Mono.CSharp {
                                        containing_ds = containing_ds.Parent;
                                }
                                
-                               t = NamespaceLookup (ds.Namespace, name, loc);
+                               t = NamespaceLookup (ds, name, loc);
                                if (t != null){
                                        ds.Cache [name] = t;
                                        return t;