public virtual bool CheckTypeAccess(CType type, Symbol symWhere)
{
Debug.Assert(type != null);
// Array, Ptr, Nub, etc don't matter.
type = type.GetNakedType(true);
if (!type.IsAggregateType())
{
Debug.Assert(type.IsVoidType() || type.IsErrorType() || type.IsTypeParameterType());
return(true);
}
for (AggregateType ats = type.AsAggregateType(); ats != null; ats = ats.outerType)
{
if (ACCESSERROR.ACCESSERROR_NOERROR != CheckAccessCore(ats.GetOwningAggregate(), ats.outerType, symWhere, null))
{
return(false);
}
}
TypeArray typeArgs = type.AsAggregateType().GetTypeArgsAll();
for (int i = 0; i < typeArgs.size; i++)
{
if (!CheckTypeAccess(typeArgs.Item(i), symWhere))
{
return(false);
}
}
return(true);
}