[ThreadStatic]
static Dictionary<Type, AttributeUsageAttribute> usage_cache;
- /* Treat as user types all corlib types extending System.Type that are not MonoType and TypeBuilder */
+ /* Treat as user types all corlib types extending System.Type that are not RuntimeType and TypeBuilder */
static bool IsUserCattrProvider (object obj)
{
Type type = obj as Type;
#if !FULL_AOT_RUNTIME
- if ((type is MonoType) || (type is TypeBuilder))
+ if ((type is RuntimeType) || (type is TypeBuilder))
#else
- if (type is MonoType)
+ if (type is RuntimeType)
#endif
return false;
if ((obj is Type))
return attrs;
}
- internal static Attribute GetCustomAttribute (ICustomAttributeProvider obj,
- Type attributeType,
- bool inherit)
- {
- object[] res = GetCustomAttributes (obj, attributeType, inherit);
- if (res.Length == 0)
- {
- return null;
- }
- else if (res.Length > 1)
- {
- string msg = "'{0}' has more than one attribute of type '{1}";
- msg = String.Format (msg, obj, attributeType);
- throw new AmbiguousMatchException (msg);
- }
-
- return (Attribute) res[0];
- }
-
internal static object[] GetCustomAttributes (ICustomAttributeProvider obj, Type attributeType, bool inherit)
{
if (obj == null)