do not check order sequence if option /order was not used
[mono.git] / mcs / class / IKVM.Reflection / Reader / TypeDefImpl.cs
index b04ecbc37f211ddc32c13929a9a54ea9d937f8dd..e4a036d5674cd71a26560fa0babd6f52ceb2ce4b 100644 (file)
@@ -29,7 +29,7 @@ using IKVM.Reflection.Metadata;
 
 namespace IKVM.Reflection.Reader
 {
-       sealed class TypeDefImpl : Type
+       sealed class TypeDefImpl : TypeInfo
        {
                private readonly ModuleReader module;
                private readonly int index;
@@ -291,7 +291,16 @@ namespace IKVM.Reflection.Reader
 
                public override bool IsGenericTypeDefinition
                {
-                       get { return module.GenericParam.FindFirstByOwner(this.MetadataToken) != -1; }
+                       get
+                       {
+                               if ((typeFlags & (TypeFlags.IsGenericTypeDefinition | TypeFlags.NotGenericTypeDefinition)) == 0)
+                               {
+                                       typeFlags |= module.GenericParam.FindFirstByOwner(this.MetadataToken) == -1
+                                               ? TypeFlags.NotGenericTypeDefinition
+                                               : TypeFlags.IsGenericTypeDefinition;
+                               }
+                               return (typeFlags & TypeFlags.IsGenericTypeDefinition) != 0;
+                       }
                }
 
                public override Type GetGenericTypeDefinition()
@@ -408,16 +417,9 @@ namespace IKVM.Reflection.Reader
                        get { return index == 0; }
                }
 
-               internal override IList<CustomAttributeData> GetInterfaceImplCustomAttributes(Type interfaceType, Type attributeType)
+               internal override bool IsBaked
                {
-                       foreach (int i in module.InterfaceImpl.Filter(this.MetadataToken))
-                       {
-                               if (module.ResolveType(module.InterfaceImpl.records[i].Interface, this) == interfaceType)
-                               {
-                                       return module.GetCustomAttributes((InterfaceImplTable.Index << 24) | (i + 1), attributeType);
-                               }
-                       }
-                       return Empty<CustomAttributeData>.Array;
+                       get { return true; }
                }
        }
 }