From 504a7dca82b71f3a5371ad9ae606f1e5cb8caee9 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Mon, 25 Dec 2023 09:06:34 -0500 Subject: [PATCH] Fix function/delegate link error --- IDEHelper/Compiler/BfModuleTypeUtils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IDEHelper/Compiler/BfModuleTypeUtils.cpp b/IDEHelper/Compiler/BfModuleTypeUtils.cpp index 1c6abc24..b9ed6b5a 100644 --- a/IDEHelper/Compiler/BfModuleTypeUtils.cpp +++ b/IDEHelper/Compiler/BfModuleTypeUtils.cpp @@ -4675,9 +4675,6 @@ void BfModule::DoPopulateType(BfType* resolvedTypeRef, BfPopulateType populateTy typeInstance->mInstSize = std::max(0, typeInstance->mInstSize); typeInstance->mInstAlign = std::max(0, typeInstance->mInstAlign); - if (typeInstance->IsDelegateOrFunction()) - typeInstance->mAlwaysIncludeFlags = (BfAlwaysIncludeFlags)(typeInstance->mAlwaysIncludeFlags | BfAlwaysIncludeFlag_IncludeAllMethods); - ProcessCustomAttributeData(); int packing = 0; bool isUnion = false; @@ -6540,6 +6537,9 @@ void BfModule::DoTypeInstanceMethodProcessing(BfTypeInstance* typeInstance) if (typeInstance->IncludeAllMethods()) implRequired = true; + if ((typeInstance->IsDelegateOrFunction()) && (methodDef->mName == "Invoke")) + implRequired = true; + // "AssumeInstantiated" also forces default ctor if (((typeInstance->mAlwaysIncludeFlags & BfAlwaysIncludeFlag_AssumeInstantiated) != 0) && (methodDef->IsDefaultCtor()))