A fix for bug #604748
* class.cs, typespec.cs: Search full imported attribute hierarchy
for AttributeUsage.
svn path=/trunk/mcs/; revision=157168
+2010-05-11 Marek Safar <marek.safar@gmail.com>
+
+ A fix for bug #604748
+ * class.cs, typespec.cs: Search full imported attribute hierarchy
+ for AttributeUsage.
+
2010-05-11 Marek Safar <marek.safar@gmail.com>
* namespace.cs: Ignore missing dependencies failure at
a = OptAttributes.Search (pa);
}
- if (a == null) {
- if (BaseType != TypeManager.attribute_type)
- return BaseType.GetAttributeUsage (pa);
-
+ if (a == null)
return null;
- }
return a.GetAttributeUsageAttribute ();
}
if (!pa.IsDefined)
return Attribute.DefaultUsageAttribute;
- var aua = MemberDefinition.GetAttributeUsage (pa);
- return aua ?? Attribute.DefaultUsageAttribute;
+ AttributeUsageAttribute aua = null;
+ var type = this;
+ while (type != null) {
+ aua = type.MemberDefinition.GetAttributeUsage (pa);
+ if (aua != null)
+ break;
+
+ type = type.BaseType;
+ }
+
+ return aua;
}
public virtual Type GetMetaInfo ()