1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Fixed constraint checks for inner types

This commit is contained in:
Brian Fiete 2022-06-23 13:55:34 -07:00
parent 439b34f7c2
commit bca82c231f
3 changed files with 76 additions and 6 deletions

View file

@ -713,15 +713,27 @@ const char* BfAutoComplete::GetTypeName(BfType* type)
}
void BfAutoComplete::AddInnerTypes(BfTypeInstance* typeInst, const StringImpl& filter, bool allowProtected, bool allowPrivate)
{
{
if (typeInst->IsEnum())
AddEntry(AutoCompleteEntry("valuetype", "UnderlyingType"), filter);
for (auto innerType : typeInst->mTypeDef->mNestedTypes)
{
if (innerType->mOuterType->mTypeCode == BfTypeCode_Extension)
{
if (typeInst->mDefineState < BfTypeDefineState_Defined)
mModule->PopulateType(typeInst);
if ((typeInst->mGenericTypeInfo != NULL) && (typeInst->mGenericTypeInfo->mGenericExtensionInfo != NULL))
{
if (!typeInst->mGenericTypeInfo->mGenericExtensionInfo->mConstraintsPassedSet.IsSet(innerType->mOuterType->mPartialIdx))
continue;
}
}
if (CheckProtection(innerType->mProtection, innerType, allowProtected, allowPrivate))
AddTypeDef(innerType, filter);
}
}
allowPrivate = false;
if (typeInst->mBaseType != NULL)