public bool computeCurrentBogusState()
{
if (hasBogus())
{
return checkBogus();
}
bool fBogus = false;
switch (GetTypeKind())
{
case TypeKind.TK_ParameterModifierType:
case TypeKind.TK_PointerType:
case TypeKind.TK_ArrayType:
case TypeKind.TK_NullableType:
if (GetBaseOrParameterOrElementType() != null)
{
fBogus = GetBaseOrParameterOrElementType().computeCurrentBogusState();
}
break;
case TypeKind.TK_ErrorType:
setBogus(false);
break;
case TypeKind.TK_AggregateType:
fBogus = AsAggregateType().getAggregate().computeCurrentBogusState();
for (int i = 0; !fBogus && i < AsAggregateType().GetTypeArgsAll().size; i++)
{
fBogus |= AsAggregateType().GetTypeArgsAll().Item(i).computeCurrentBogusState();
}
break;
case TypeKind.TK_TypeParameterType:
case TypeKind.TK_VoidType:
case TypeKind.TK_NullType:
case TypeKind.TK_OpenTypePlaceholderType:
case TypeKind.TK_ArgumentListType:
case TypeKind.TK_NaturalIntegerType:
setBogus(false);
break;
default:
throw Error.InternalCompilerError();
//setBogus(false);
//break;
}
if (fBogus)
{
// Only set this if at least 1 declared thing is bogus
setBogus(fBogus);
}
return hasBogus() && checkBogus();
}