namespace IKVM.Reflection.Reader
{
- sealed class TypeDefImpl : Type
+ sealed class TypeDefImpl : TypeInfo
{
private readonly ModuleReader module;
private readonly int index;
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()
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; }
}
}
}