From 48571d374fb68d853a0d930175e48d19caf50c9c Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Sun, 19 Jun 2022 06:25:28 -0700 Subject: [PATCH] Fixed GetMethodByName for methods in conditional extensions --- IDEHelper/Compiler/BfModule.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index 2b56dea2..fe5be56d 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -10827,10 +10827,14 @@ BfModuleMethodInstance BfModule::GetMethodByName(BfTypeInstance* typeInstance, c while (methodDef != NULL) { - if ((methodDef->mMethodType != BfMethodType_Mixin) && + if ((methodDef->mMethodType != BfMethodType_Mixin) && (methodDef->mGenericParams.size() == 0) && - ((paramCount == -1) || (paramCount == (int)methodDef->mParams.size()))) - return GetMethodInstanceAtIdx(typeInstance, methodDef->mIdx); + ((paramCount == -1) || (paramCount == (int)methodDef->mParams.size()))) + { + auto moduleMethodInstance = GetMethodInstanceAtIdx(typeInstance, methodDef->mIdx); + if (moduleMethodInstance) + return moduleMethodInstance; + } methodDef = methodDef->mNextWithSameName; }