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.
if (error)
return null;
- if (match != null){
+ if (match != null && CheckAccessLevel (match)){
if (t != null){
Error_AmbiguousTypeReference (loc, name, t, match);
return null;
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;
//
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;
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;