"System.ParamArrayAttribute",
"System.Security.UnverifiableCodeAttribute",
"System.Runtime.CompilerServices.IndexerNameAttribute",
+ "System.Runtime.InteropServices.InAttribute"
};
// We must store them here before calling BootstrapCorlib_ResolveDelegate.
if (root.Delegates != null)
foreach (Delegate d in root.Delegates)
- d.CloseDelegate ();
+ d.CloseType ();
//
return ns.Substring (0, i);
}
- static Type NamespaceLookup (Namespace curr_ns, string name)
+ static Type NamespaceLookup (Namespace curr_ns, string name, Location loc)
{
Type t;
if (using_list == null)
continue;
+ Type match = null;
foreach (Namespace.UsingEntry ue in using_list) {
- t = TypeManager.LookupType (MakeFQN (ue.Name, name));
- if (t != null){
+ match = TypeManager.LookupType (MakeFQN (ue.Name, name));
+ if (match != null){
+ if (t != null){
+ DeclSpace.Error_AmbiguousTypeReference (loc, name, t, match);
+ return null;
+ }
+
+ t = match;
ue.Used = true;
- return t;
}
}
+ if (t != null)
+ return t;
//
// Try with aliases
//
// nested class
//
- t = TypeManager.LookupType (current_type.FullName + "+" + name);
+ t = TypeManager.LookupType (current_type.FullName + "." + name);
if (t != null){
ds.Cache [name] = t;
return t;
containing_ds = containing_ds.Parent;
}
- t = NamespaceLookup (ds.Namespace, name);
+ t = NamespaceLookup (ds.Namespace, name, loc);
if (t != null){
ds.Cache [name] = t;
return t;
if (type_container_resolve_order != null){
- foreach (TypeContainer tc in type_container_resolve_order) {
- // When compiling corlib, these types have already been
- // populated from BootCorlib_PopulateCoreTypes ().
- if (!RootContext.StdLib &&
- ((tc.Name == "System.Object") ||
- (tc.Name == "System.Attribute") ||
- (tc.Name == "System.ValueType")))
+ if (RootContext.StdLib){
+ foreach (TypeContainer tc in type_container_resolve_order) {
+ if ((tc.ModFlags & Modifiers.NEW) == 0)
+ tc.DefineMembers (root);
+ else
+ Report1530 (tc.Location);
+ }
+ } else {
+ foreach (TypeContainer tc in type_container_resolve_order) {
+ // When compiling corlib, these types have already been
+ // populated from BootCorlib_PopulateCoreTypes ().
+ if (((tc.Name == "System.Object") ||
+ (tc.Name == "System.Attribute") ||
+ (tc.Name == "System.ValueType")))
continue;
- if ((tc.ModFlags & Modifiers.NEW) == 0)
- tc.DefineMembers (root);
- else
- Report1530 (tc.Location);
- }
+ if ((tc.ModFlags & Modifiers.NEW) == 0)
+ tc.DefineMembers (root);
+ else
+ Report1530 (tc.Location);
+ }
+ }
}
ArrayList delegates = root.Delegates;
Attributes attrs = (Attributes) de.Value;
dummy.Namespace = ns;
- Attribute.ApplyAttributes (temp_ec, ab, ab, attrs, attrs.Location);
+ Attribute.ApplyAttributes (temp_ec, ab, ab, attrs);
}
}
return;
}
- CustomAttributeBuilder cb = new CustomAttributeBuilder (TypeManager.unverifiable_code_ctor, new object [0]);
+ CustomAttributeBuilder cb = new CustomAttributeBuilder (TypeManager.unverifiable_code_ctor,
+ new object [0]);
CodeGen.ModuleBuilder.SetCustomAttribute (cb);
}
}
// Adds a global attribute that was declared in `container',
// the attribute is in `attr', and it was defined at `loc'
//
- static public void AddGlobalAttribute (TypeContainer container,
- AttributeSection attr, Location loc)
+ static public void AddGlobalAttributeSection (TypeContainer container, AttributeSection attr)
{
Namespace ns = container.Namespace;
Attributes a = (Attributes) global_attributes [ns];
if (a == null)
- global_attributes [ns] = new Attributes (attr, loc);
+ global_attributes [ns] = new Attributes (attr);
else
- a.AddAttribute (attr);
+ a.AddAttributeSection (attr);
}
}
}