1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Allow CreateObject for default ctors with append allocs

This commit is contained in:
Brian Fiete 2022-01-29 09:57:43 -05:00
parent aba01b2cc8
commit 3338f3c069
5 changed files with 61 additions and 14 deletions

View file

@ -550,7 +550,14 @@ bool BfMethodDef::IsEmptyPartial()
bool BfMethodDef::IsDefaultCtor()
{
return ((mMethodType == BfMethodType_Ctor) || (mMethodType == BfMethodType_CtorNoBody)) && (mParams.IsEmpty());
if ((mMethodType == BfMethodType_Ctor) || (mMethodType == BfMethodType_CtorNoBody))
{
return ((mParams.IsEmpty()) ||
((mParams.mSize == 1) && (mParams[0]->mParamKind == BfParamKind_AppendIdx)));
}
else if (mMethodType == BfMethodType_CtorCalcAppend)
return mParams.IsEmpty();
return false;
}
bool BfMethodDef::IsCtorOrInit()