From 8b74b151020a3e71944391980ce04eb02bb1e436 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Mon, 26 Oct 2020 10:47:01 -0700 Subject: [PATCH] Fixed internal override mangling in same project --- IDEHelper/Compiler/BfModule.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index 90e1dafe..bac72c2f 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -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); } }