if (obsolete_attr == null)
return null;
- ObsoleteAttribute obsolete = obsolete_attr.GetObsoleteAttribute (ds);
+ ObsoleteAttribute obsolete = obsolete_attr.GetObsoleteAttribute (ds.EmitContext);
if (obsolete == null)
return null;
TypeManager.cls_compliant_attribute_type, ds.EmitContext);
if (cls_attribute != null) {
caching_flags |= Flags.HasClsCompliantAttribute;
- return cls_attribute.GetClsCompliantAttributeValue (ds);
+ return cls_attribute.GetClsCompliantAttributeValue (ds.EmitContext);
}
}
return ds.GetClsCompliantAttributeValue ();
protected virtual bool VerifyClsCompliance (DeclSpace ds)
{
if (!IsClsCompliaceRequired (ds)) {
- if ((RootContext.WarningLevel >= 2) && HasClsCompliantAttribute && !IsExposedFromAssembly (ds)) {
- Report.Warning (3019, Location, "CLS compliance checking will not be performed on '{0}' because it is private or internal", GetSignatureForError ());
+ if (HasClsCompliantAttribute && RootContext.WarningLevel >= 2) {
+ if (!IsExposedFromAssembly (ds))
+ Report.Warning (3019, Location, "CLS compliance checking will not be performed on '{0}' because it is private or internal", GetSignatureForError ());
+ if (!CodeGen.Assembly.IsClsCompliant)
+ Report.Warning (3021, Location, "'{0}' does not need a CLSCompliant attribute because the assembly does not have a CLSCompliant attribute", GetSignatureForError ());
}
return false;
}
{
if (basename == Basename && !(this is Interface)) {
Report.SymbolRelatedToPreviousError (this);
- Report.Error (542, "'{0}': member names cannot be the same as their enclosing type", symbol.Location, symbol.GetSignatureForError ());
+ Report.Error (542, symbol.Location, "'{0}': member names cannot be the same as their enclosing type", symbol.GetSignatureForError ());
return false;
}
Attribute cls_attribute = OptAttributes.Search (TypeManager.cls_compliant_attribute_type, ec);
if (cls_attribute != null) {
caching_flags |= Flags.HasClsCompliantAttribute;
- if (cls_attribute.GetClsCompliantAttributeValue (this)) {
+ if (cls_attribute.GetClsCompliantAttributeValue (ec)) {
caching_flags |= Flags.ClsCompliantAttributeTrue;
return true;
}
}
/// <summary>
- /// Returns the IMemberContainer of the parent class or null if this
+ /// Returns the IMemberContainer of the base class or null if this
/// is an interface or TypeManger.object_type.
/// This is used when creating the member cache for a class to get all
- /// members from the parent class.
+ /// members from the base class.
/// </summary>
- MemberCache ParentCache {
+ MemberCache BaseCache {
get;
}
Timer.IncrementCounter (CounterType.MemberCache);
Timer.StartTimer (TimerType.CacheInit);
- // If we have a parent class (we have a parent class unless we're
+ // If we have a base class (we have a base class unless we're
// TypeManager.object_type), we deep-copy its MemberCache here.
- if (Container.ParentCache != null)
- member_hash = SetupCache (Container.ParentCache);
+ if (Container.BaseCache != null)
+ member_hash = SetupCache (Container.BaseCache);
else
member_hash = new Hashtable ();
}
/// <summary>
- /// Bootstrap this member cache by doing a deep-copy of our parent.
+ /// Bootstrap this member cache by doing a deep-copy of our base.
/// </summary>
- Hashtable SetupCache (MemberCache parent)
+ Hashtable SetupCache (MemberCache base_class)
{
Hashtable hash = new Hashtable ();
- if (parent == null)
+ if (base_class == null)
return hash;
- IDictionaryEnumerator it = parent.member_hash.GetEnumerator ();
+ IDictionaryEnumerator it = base_class.member_hash.GetEnumerator ();
while (it.MoveNext ()) {
hash [it.Key] = ((ArrayList) it.Value).Clone ();
}
}
// When this method is called for the current class, the list will
- // already contain all inherited members from our parent classes.
+ // already contain all inherited members from our base classes.
// We cannot add new members in front of the list since this'd be an
// expensive operation, that's why the list is sorted in reverse order
// (ie. members from the current class are coming last).
// `applicable' is a list of all members with the given member name `name'
- // in the current class and all its parent classes. The list is sorted in
+ // in the current class and all its base classes. The list is sorted in
// reverse order due to the way how the cache is initialy created (to speed
- // things up, we're doing a deep-copy of our parent).
+ // things up, we're doing a deep-copy of our base).
for (int i = applicable.Count-1; i >= 0; i--) {
CacheEntry entry = (CacheEntry) applicable [i];