Merge pull request #3066 from alexanderkyte/pedump_sgen
[mono.git] / mcs / class / corlib / System / MonoCustomAttrs.cs
index f69fe0c1c28b83f1f488c61e65bcbc38f8f3d9fd..8894ec98c98a6508329ec496e6dd3248269c1208 100644 (file)
@@ -49,14 +49,14 @@ namespace System
                [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))
@@ -144,25 +144,6 @@ namespace System
                        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)