From e09b701e9ff83a7b625ba892b33deabe72090555 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 24 Aug 2022 08:32:19 -0700 Subject: [PATCH] Fixed named parameters in extension methods --- IDEHelper/Compiler/BfSystem.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/IDEHelper/Compiler/BfSystem.cpp b/IDEHelper/Compiler/BfSystem.cpp index cd6870f0..b5b4c65a 100644 --- a/IDEHelper/Compiler/BfSystem.cpp +++ b/IDEHelper/Compiler/BfSystem.cpp @@ -666,9 +666,13 @@ void BfMethodDef::BuildParamNameMap() if (mParamNameMap != NULL) return; + int startIdx = 0; + if (mMethodType == BfMethodType_Extension) + startIdx = 1; + mParamNameMap = new Dictionary(); - for (int i = 0; i < mParams.mSize; i++) - (*mParamNameMap)[mParams[i]->mName] = i; + for (int i = startIdx; i < mParams.mSize; i++) + (*mParamNameMap)[mParams[i]->mName] = i - startIdx; } ///