1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Added type initializer blocks

This commit is contained in:
Brian Fiete 2020-10-23 07:48:41 -07:00
parent 9a857cceb3
commit 879b15ecd8
6 changed files with 154 additions and 71 deletions

View file

@ -6910,16 +6910,22 @@ bool BfCompiler::DoCompile(const StringImpl& outputDirectory)
{
if ((methodInstGroup.mOnDemandKind == BfMethodOnDemandKind_Decl_AwaitingReference) ||
(methodInstGroup.mOnDemandKind == BfMethodOnDemandKind_NoDecl_AwaitingReference))
{
queuedMoreMethods = true;
{
if ((methodInstGroup.mDefault != NULL) && (methodInstGroup.mDefault->mIsForeignMethodDef))
{
mContext->mUnreifiedModule->GetMethodInstance(typeInst, methodInstGroup.mDefault->mMethodDef, BfTypeVector(),
(BfGetMethodInstanceFlags)(BfGetMethodInstanceFlag_ForeignMethodDef | BfGetMethodInstanceFlag_UnspecializedPass | BfGetMethodInstanceFlag_ExplicitResolveOnlyPass));
queuedMoreMethods = true;
}
else
mContext->mUnreifiedModule->GetMethodInstance(typeInst, typeInst->mTypeDef->mMethods[methodInstGroup.mMethodIdx], BfTypeVector(),
{
auto methodDef = typeInst->mTypeDef->mMethods[methodInstGroup.mMethodIdx];
if (methodDef->mMethodType == BfMethodType_Init)
continue;
mContext->mUnreifiedModule->GetMethodInstance(typeInst, methodDef, BfTypeVector(),
(BfGetMethodInstanceFlags)(BfGetMethodInstanceFlag_UnspecializedPass | BfGetMethodInstanceFlag_ExplicitResolveOnlyPass));
queuedMoreMethods = true;
}
}
}
}