mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 20:12: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* methodDef;
|
||||||
|
|
||||||
if (methodDeclaration != NULL)
|
|
||||||
{
|
|
||||||
BfDefBuilder defBuilder(mCompiler->mSystem);
|
|
||||||
defBuilder.mPassInstance = mCompiler->mPassInstance;
|
|
||||||
defBuilder.mCurTypeDef = mCurMethodInstance->mMethodDef->mDeclaringType;
|
|
||||||
|
|
||||||
BfMethodDef* outerMethodDef = NULL;
|
BfMethodDef* outerMethodDef = NULL;
|
||||||
if (localMethod->mOuterLocalMethod != NULL)
|
if (localMethod->mOuterLocalMethod != NULL)
|
||||||
outerMethodDef = localMethod->mOuterLocalMethod->mMethodDef;
|
outerMethodDef = localMethod->mOuterLocalMethod->mMethodDef;
|
||||||
else
|
else
|
||||||
outerMethodDef = rootMethodState->mMethodInstance->mMethodDef;
|
outerMethodDef = rootMethodState->mMethodInstance->mMethodDef;
|
||||||
|
|
||||||
|
if (methodDeclaration != NULL)
|
||||||
|
{
|
||||||
|
BfDefBuilder defBuilder(mCompiler->mSystem);
|
||||||
|
defBuilder.mPassInstance = mCompiler->mPassInstance;
|
||||||
|
defBuilder.mCurTypeDef = mCurMethodInstance->mMethodDef->mDeclaringType;
|
||||||
|
|
||||||
methodDef = defBuilder.CreateMethodDef(methodDeclaration, outerMethodDef);
|
methodDef = defBuilder.CreateMethodDef(methodDeclaration, outerMethodDef);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -18044,6 +18044,16 @@ BfMethodDef* BfModule::GetLocalMethodDef(BfLocalMethod* localMethod)
|
||||||
paramDef->mName = paramName;
|
paramDef->mName = paramName;
|
||||||
methodDef->mParams.Add(paramDef);
|
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;
|
methodDef->mIdx = ~methodLocalIdx;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue