private static bool AreSame(TypeReference a, TypeReference b)
{
if (a == b)
{
return(true);
}
if (a == null || b == null)
{
return(false);
}
if (a.etype != b.etype)
{
return(false);
}
if (a.IsGenericParameter)
{
return(MetadataResolver.AreSame((GenericParameter)a, (GenericParameter)b));
}
if (a.IsTypeSpecification())
{
return(MetadataResolver.AreSame((TypeSpecification)a, (TypeSpecification)b));
}
if (a.Name != b.Name || a.Namespace != b.Namespace)
{
return(false);
}
return(MetadataResolver.AreSame(a.DeclaringType, b.DeclaringType));
}