1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed internal override mangling in same project

This commit is contained in:
Brian Fiete 2020-10-26 10:47:01 -07:00
parent 84594e66ff
commit 8b74b15102

View file

@ -20222,7 +20222,12 @@ void BfModule::SetupIRFunction(BfMethodInstance* methodInstance, StringImpl& man
prevFunc = mBfIRBuilder->GetFunction(mangledName);
if (prevFunc)
{
if (methodDef->mIsExtern)
if ((methodDef->mIsOverride) && (mCurTypeInstance->mTypeDef->mIsCombinedPartial))
{
BfLogSysM("Function collision from inner override erased prevFunc %p: %d\n", methodInstance, prevFunc.mId);
mBfIRBuilder->Func_EraseFromParent(prevFunc);
}
else if (methodDef->mIsExtern)
{
// Allow this
BfLogSysM("Function collision allowed multiple extern functions for %p: %d\n", methodInstance, prevFunc.mId);
@ -20242,7 +20247,6 @@ void BfModule::SetupIRFunction(BfMethodInstance* methodInstance, StringImpl& man
else
{
BfLogSysM("Function collision erased prevFunc %p: %d\n", methodInstance, prevFunc.mId);
mBfIRBuilder->Func_EraseFromParent(prevFunc);
}
}