1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Improved comptime TypeDeclaration support, reworked base type population

This commit is contained in:
Brian Fiete 2025-01-14 12:54:24 -08:00
parent 16371ab07c
commit 062170d9e0
5 changed files with 22 additions and 9 deletions

View file

@ -4240,7 +4240,7 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
if ((checkType != NULL) && (!checkType->IsInterface()) && (populateBase))
{
SetAndRestoreValue<BfTypeInstance*> prevBaseType(mContext->mCurTypeState->mCurBaseType, checkType->ToTypeInstance());
PopulateType(checkType, (populateType <= BfPopulateType_BaseType) ? BfPopulateType_BaseType : BfPopulateType_Data);
PopulateType(checkType, BfPopulateType_Declaration);
}
if (typeInstance->mDefineState >= BfTypeDefineState_Defined)
@ -4466,7 +4466,9 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
baseTypeInst = ResolveTypeDef(mCompiler->mBfObjectTypeDef)->ToTypeInstance();
}
}
PopulateType(baseTypeInst, BfPopulateType_Data);
if (populateType > BfPopulateType_CustomAttributes)
PopulateType(baseTypeInst, BfPopulateType_Data);
typeInstance->mBaseTypeMayBeIncomplete = false;
@ -4746,6 +4748,9 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
}
}
if (typeInstance->mDefineState < BfTypeDefineState_HasCustomAttributes)
typeInstance->mDefineState = BfTypeDefineState_HasCustomAttributes;
if (typeInstance->mTypeOptionsIdx == -2)
{
SetTypeOptions(typeInstance);