private TypeReference ImportTypeSpecification(Type type, ImportGenericContext context)
{
if (type.IsByRef)
{
return(new ByReferenceType(this.ImportType(type.GetElementType(), context)));
}
if (type.IsPointer)
{
return(new PointerType(this.ImportType(type.GetElementType(), context)));
}
if (type.IsArray)
{
return(new ArrayType(this.ImportType(type.GetElementType(), context), type.GetArrayRank()));
}
if (type.IsGenericType)
{
return(this.ImportGenericInstance(type, context));
}
if (!type.IsGenericParameter)
{
throw new NotSupportedException(type.FullName);
}
return(MetadataImporter.ImportGenericParameter(type, context));
}