//
// Author:
// Miguel de Icaza (miguel@ximian.com)
+// Marek Safar (marek.safar@seznam.cz)
//
// (C) 2001 Ximian, Inc.
//
EnsureNamespace (t.Namespace);
}
+ public override void Error_NamespaceDoesNotExist(Location loc, string name)
+ {
+ Report.Error (400, loc, "The type or namespace name `{0}' could not be found in the global namespace (are you missing an assembly reference?)",
+ name);
+ }
+
public override Type LookupTypeReflection (string name, Location loc)
{
Type found_type = null;
return this;
}
+ public virtual void Error_NamespaceDoesNotExist (Location loc, string name)
+ {
+ Report.Error (234, loc, "The type or namespace name `{0}' does not exist in the namespace `{1}'. Are you missing an assembly reference?",
+ name, FullName);
+ }
+
public override void Emit (EmitContext ec)
{
throw new InternalErrorException ("Expression tree referenced namespace " + fullname + " during Emit ()");
root.NamespaceEntry = null;
if (resolved == null)
- Error_NamespaceNotFound (Location, Alias.ToString ());
+ return null;
+
+ if (resolved.Type != null) {
+ TypeAttributes attr = resolved.Type.Attributes & TypeAttributes.VisibilityMask;
+ if (attr == TypeAttributes.NestedPrivate || attr == TypeAttributes.NestedFamily ||
+ ((attr == TypeAttributes.NestedFamORAssem || attr == TypeAttributes.NestedAssembly) &&
+ TypeManager.LookupDeclSpace (resolved.Type) == null)) {
+ Expression.ErrorIsInaccesible (Alias.Location, Alias.ToString ());
+ return null;
+ }
+ }
+
return resolved;
}
}