1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-11 04:52:21 +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); methodDef->mName.RemoveToEnd(prevSepPos);
} }
// if (closureTypeInst != NULL) // 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)
// StringT<128> typeInstName; {
// BfMangler::Mangle(typeInstName,mModule->mCompiler->GetMangleKind(), closureTypeInst); if (auto ctorDecl = BfNodeDynCast<BfConstructorDeclaration>(mModule->mCurMethodInstance->mMethodDef->mMethodDeclaration))
// closureHashCtx.MixinStr(typeInstName); {
// } if (ctorDecl->mThisToken != NULL)
closureHashCtx.Mixin(ctorDecl->mThisToken->GetStartCharId());
}
}
auto checkMethodState = mModule->mCurMethodState; auto checkMethodState = mModule->mCurMethodState;
while (checkMethodState != NULL) while (checkMethodState != NULL)