public bool DependsOn(TypeParameterType pType)
{
Debug.Assert(pType != null);
// * If a type parameter T is used as a constraint for type parameter S
// then S depends on T.
// * If a type parameter S depends on a type parameter T and T depends on
// U then S depends on U.
TypeArray pConstraints = GetBounds();
for (int iConstraint = 0; iConstraint < pConstraints.Count; ++iConstraint)
{
CType pConstraint = pConstraints[iConstraint];
if (pConstraint == pType)
{
return(true);
}
if (pConstraint.IsTypeParameterType() &&
pConstraint.AsTypeParameterType().DependsOn(pType))
{
return(true);
}
}
return(false);
}