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

DynamicCastToSignature release fix

This commit is contained in:
Brian Fiete 2025-03-22 16:08:14 -04:00
parent 37f72cd3b6
commit c7da3e15f9
4 changed files with 9 additions and 9 deletions

View file

@ -1355,9 +1355,9 @@ BfMethodDef* BfDefBuilder::AddDtor(BfTypeDef* typeDef)
return methodDef;
}
void BfDefBuilder::AddDynamicCastMethods(BfTypeDef* typeDef)
void BfDefBuilder::AddDynamicCastMethods(BfTypeDef* typeDef, bool needsDynamicCastMethods)
{
//
if (needsDynamicCastMethods)
{
auto methodDef = new BfMethodDef();
methodDef->mIdx = (int)typeDef->mMethods.size();
@ -1378,7 +1378,7 @@ void BfDefBuilder::AddDynamicCastMethods(BfTypeDef* typeDef)
methodDef->mIsNoReflect = true;
}
//
if (needsDynamicCastMethods)
{
auto methodDef = new BfMethodDef();
methodDef->mIdx = (int)typeDef->mMethods.size();
@ -2392,10 +2392,10 @@ void BfDefBuilder::FinishTypeDef(bool wantsToString)
isAutocomplete = true;
//TODO: Don't do this for the autocomplete pass
if ((needsDynamicCastMethod) && (mCurTypeDef->mTypeCode != BfTypeCode_Interface) && (mCurTypeDef->mTypeCode != BfTypeCode_Extension) &&
if ((mCurTypeDef->mTypeCode != BfTypeCode_Interface) && (mCurTypeDef->mTypeCode != BfTypeCode_Extension) &&
(!mCurTypeDef->mIsStatic) && (!isAutocomplete) && (!isAlias) && (!mCurTypeDef->mIsOpaque))
{
AddDynamicCastMethods(mCurTypeDef);
AddDynamicCastMethods(mCurTypeDef, needsDynamicCastMethod);
}
bool isPayloadEnum = false;