private bool UpperBoundClassInference(AggregateType pSource, CType pDest)
{
if (!pSource.isClassType() || !pDest.isClassType())
{
return false;
}
// SPEC: Otherwise, if U is a class CType C<U1...Uk> and V is a class CType which
// SPEC: inherits directly or indirectly from C<V1...Vk> then an exact
// SPEC: inference is made from each Ui to the corresponding Vi.
AggregateType pDestBase = pDest.AsAggregateType().GetBaseClass();
while (pDestBase != null)
{
if (pDestBase.GetOwningAggregate() == pSource.GetOwningAggregate())
{
ExactTypeArgumentInference(pSource, pDestBase);
return true;
}
pDestBase = pDestBase.GetBaseClass();
}
return false;
}