mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed circular reference inheritance issue with interfaces
This commit is contained in:
parent
111631dd9c
commit
ee8c062253
1 changed files with 16 additions and 1 deletions
|
@ -2712,6 +2712,10 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
for (int iFaceIdx = 0; iFaceIdx < (int)interfaces.size(); iFaceIdx++)
|
for (int iFaceIdx = 0; iFaceIdx < (int)interfaces.size(); iFaceIdx++)
|
||||||
{
|
{
|
||||||
auto checkInterface = interfaces[iFaceIdx].mIFaceTypeInst;
|
auto checkInterface = interfaces[iFaceIdx].mIFaceTypeInst;
|
||||||
|
|
||||||
|
SetAndRestoreValue<BfTypeDef*> prevTypeDef(mContext->mCurTypeState->mCurTypeDef, interfaces[iFaceIdx].mDeclaringType);
|
||||||
|
SetAndRestoreValue<BfTypeReference*> prevTypeRef(mContext->mCurTypeState->mCurBaseTypeRef, interfaces[iFaceIdx].mTypeRef);
|
||||||
|
|
||||||
PopulateType(checkInterface, BfPopulateType_Data);
|
PopulateType(checkInterface, BfPopulateType_Data);
|
||||||
|
|
||||||
BfTypeInterfaceEntry* found = NULL;
|
BfTypeInterfaceEntry* found = NULL;
|
||||||
|
@ -2750,6 +2754,16 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
interfaces.push_back(depIFaceEntry);
|
interfaces.push_back(depIFaceEntry);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeInstance->mTypeFailed)
|
||||||
|
{
|
||||||
|
// Circular references in interfaces - just clear them all out
|
||||||
|
typeInstance->mInterfaces.Clear();
|
||||||
|
interfaces.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_CheckTypeDone())
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mCompiler->mOptions.mAllowHotSwapping) &&
|
if ((mCompiler->mOptions.mAllowHotSwapping) &&
|
||||||
|
@ -2791,7 +2805,8 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy
|
||||||
}
|
}
|
||||||
|
|
||||||
BF_ASSERT(!typeInstance->mNeedsMethodProcessing);
|
BF_ASSERT(!typeInstance->mNeedsMethodProcessing);
|
||||||
typeInstance->mDefineState = BfTypeDefineState_HasInterfaces;
|
if (typeInstance->mDefineState < BfTypeDefineState_HasInterfaces)
|
||||||
|
typeInstance->mDefineState = BfTypeDefineState_HasInterfaces;
|
||||||
|
|
||||||
for (auto& validateEntry : deferredTypeValidateList)
|
for (auto& validateEntry : deferredTypeValidateList)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue