1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 20:12:21 +02:00

Fixed appended field dtor with extensions

This commit is contained in:
Brian Fiete 2022-07-05 09:24:04 -07:00
parent 4d1d972599
commit 08a63e5b9f
2 changed files with 8 additions and 0 deletions

View file

@ -17033,6 +17033,12 @@ void BfModule::EmitDtorBody()
if ((fieldDef != NULL) && (fieldDef->mIsStatic == methodDef->mIsStatic) && (fieldInst->IsAppendedObject())) if ((fieldDef != NULL) && (fieldDef->mIsStatic == methodDef->mIsStatic) && (fieldInst->IsAppendedObject()))
{ {
if (fieldDef->mDeclaringType != mCurMethodInstance->mMethodDef->mDeclaringType)
{
BF_ASSERT(mCurTypeInstance->mTypeDef->mIsCombinedPartial);
continue;
}
auto refNode = fieldDef->GetRefNode(); auto refNode = fieldDef->GetRefNode();
UpdateSrcPos(refNode); UpdateSrcPos(refNode);

View file

@ -3319,6 +3319,8 @@ void BfSystem::FinishCompositePartial(BfTypeDef* compositeTypeDef)
if (auto paramDeclaration = BfNodeDynCast<BfParameterDeclaration>(fieldDef->mFieldDeclaration)) if (auto paramDeclaration = BfNodeDynCast<BfParameterDeclaration>(fieldDef->mFieldDeclaration))
if (paramDeclaration->mInitializer != NULL) if (paramDeclaration->mInitializer != NULL)
hasInitializers = true; hasInitializers = true;
if (fieldDef->mIsAppend)
hasInitializers = true;
} }
} }