diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 6a66d5ed..8df36d1e 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -10150,16 +10150,21 @@ void BfExprEvaluator::Visit(BfDelegateBindExpression* delegateBindExpr) auto _GetInvokeMethodName = [&]() { - String methodName = "Invoke@"; + String methodName = "Invoke$"; methodName += mModule->mCurMethodInstance->mMethodDef->mName; + int prevSepPos = (int)methodName.LastIndexOf('$'); - if (prevSepPos != -1) + if (prevSepPos > 6) { methodName.RemoveToEnd(prevSepPos); } auto rootMethodState = mModule->mCurMethodState->GetRootMethodState(); HashContext hashCtx; + + if (mModule->mCurMethodInstance->mMethodDef->mDeclaringType->mPartialIdx != -1) + hashCtx.Mixin(mModule->mCurMethodInstance->mMethodDef->mDeclaringType->mPartialIdx); + if (delegateBindExpr->mFatArrowToken != NULL) { hashCtx.Mixin(delegateBindExpr->mFatArrowToken->GetStartCharId()); @@ -10178,7 +10183,10 @@ void BfExprEvaluator::Visit(BfDelegateBindExpression* delegateBindExpr) methodName += '$'; methodName += BfTypeUtils::HashEncode64(hashVal.mLow); - return methodName; + + String mangledName; + BfMangler::MangleMethodName(mangledName, mModule->mCompiler->GetMangleKind(), mModule->mCurTypeInstance, methodName); + return mangledName; }; if ((delegateBindExpr->mNewToken == NULL) || (delegateTypeInstance->IsFunction())) diff --git a/IDEHelper/Compiler/BfMangler.cpp b/IDEHelper/Compiler/BfMangler.cpp index 5efe4d8d..9746c74a 100644 --- a/IDEHelper/Compiler/BfMangler.cpp +++ b/IDEHelper/Compiler/BfMangler.cpp @@ -2180,8 +2180,8 @@ void BfMSMangler::MangleMethodName(StringImpl& name, bool is64Bit, BfTypeInstanc mangleContext.mModule = type->GetModule(); name += '?'; AddStr(mangleContext, name, methodName); - Mangle(mangleContext, name, type); - name += "@@"; + Mangle(mangleContext, name, type, true); + name += "SAXXZ"; } void BfMSMangler::MangleStaticFieldName(StringImpl& name, bool is64Bit, BfTypeInstance* owner, const StringImpl& fieldName, BfType* fieldType)