1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Field lambda name collision inside field ctor with multiple ctors

This commit is contained in:
Brian Fiete 2020-10-20 06:44:06 -07:00
parent a3211809c6
commit affd740ff4

View file

@ -11549,12 +11549,15 @@ BfLambdaInstance* BfExprEvaluator::GetLambdaInstance(BfLambdaBindExpression* lam
methodDef->mName.RemoveToEnd(prevSepPos);
}
// if (closureTypeInst != NULL)
// {
// StringT<128> typeInstName;
// BfMangler::Mangle(typeInstName,mModule->mCompiler->GetMangleKind(), closureTypeInst);
// closureHashCtx.MixinStr(typeInstName);
// }
// Mix in this because this can be emitted multiple times when there's multiple ctors and field initializers with lambdas
if (mModule->mCurMethodInstance->mMethodDef->mMethodType == BfMethodType_Ctor)
{
if (auto ctorDecl = BfNodeDynCast<BfConstructorDeclaration>(mModule->mCurMethodInstance->mMethodDef->mMethodDeclaration))
{
if (ctorDecl->mThisToken != NULL)
closureHashCtx.Mixin(ctorDecl->mThisToken->GetStartCharId());
}
}
auto checkMethodState = mModule->mCurMethodState;
while (checkMethodState != NULL)