private CType GetConstructedType(Type type, AggregateSymbol agg)
{
// We've found the one we want, so return it.
if (type.GetTypeInfo().IsGenericType)
{
// If we're a generic type, then we need to add the type arguments.
List<CType> types = new List<CType>();
foreach (Type argument in type.GetGenericArguments())
{
types.Add(GetCTypeFromType(argument));
}
TypeArray typeArray = _bsymmgr.AllocParams(types.ToArray());
AggregateType aggType = _typeManager.GetAggregate(agg, typeArray);
return aggType;
}
CType ctype = agg.getThisType();
return ctype;
}