mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Fixed methodRef lambdas with outer generics
This commit is contained in:
parent
e90e8aee47
commit
44bd9c698f
1 changed files with 17 additions and 7 deletions
|
@ -18006,18 +18006,18 @@ BfMethodDef* BfModule::GetLocalMethodDef(BfLocalMethod* localMethod)
|
|||
|
||||
BfMethodDef* methodDef;
|
||||
|
||||
BfMethodDef* outerMethodDef = NULL;
|
||||
if (localMethod->mOuterLocalMethod != NULL)
|
||||
outerMethodDef = localMethod->mOuterLocalMethod->mMethodDef;
|
||||
else
|
||||
outerMethodDef = rootMethodState->mMethodInstance->mMethodDef;
|
||||
|
||||
if (methodDeclaration != NULL)
|
||||
{
|
||||
BfDefBuilder defBuilder(mCompiler->mSystem);
|
||||
defBuilder.mPassInstance = mCompiler->mPassInstance;
|
||||
defBuilder.mCurTypeDef = mCurMethodInstance->mMethodDef->mDeclaringType;
|
||||
|
||||
BfMethodDef* outerMethodDef = NULL;
|
||||
if (localMethod->mOuterLocalMethod != NULL)
|
||||
outerMethodDef = localMethod->mOuterLocalMethod->mMethodDef;
|
||||
else
|
||||
outerMethodDef = rootMethodState->mMethodInstance->mMethodDef;
|
||||
|
||||
|
||||
methodDef = defBuilder.CreateMethodDef(methodDeclaration, outerMethodDef);
|
||||
}
|
||||
else
|
||||
|
@ -18044,6 +18044,16 @@ BfMethodDef* BfModule::GetLocalMethodDef(BfLocalMethod* localMethod)
|
|||
paramDef->mName = paramName;
|
||||
methodDef->mParams.Add(paramDef);
|
||||
}
|
||||
|
||||
if (outerMethodDef != NULL)
|
||||
{
|
||||
for (auto genericParam : outerMethodDef->mGenericParams)
|
||||
{
|
||||
auto* copiedGenericParamDef = new BfGenericParamDef();
|
||||
*copiedGenericParamDef = *genericParam;
|
||||
methodDef->mGenericParams.Add(copiedGenericParamDef);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
methodDef->mIdx = ~methodLocalIdx;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue