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

Added uninitialized ctors: this(?), base(?)

This commit is contained in:
Brian Fiete 2020-03-25 09:17:34 -07:00
parent 48e752e95f
commit dde6a56a03

View file

@ -14587,6 +14587,24 @@ void BfModule::EmitCtorBody(bool& skipBody)
mCurMethodState->mCurAppendAlign = methodInstance->mAppendAllocAlign;
}
if ((ctorDeclaration != NULL) && (ctorDeclaration->mInitializer != NULL) && (ctorDeclaration->mInitializer->mArguments.size() == 1) && (targetType != NULL))
{
if (auto tokenNode = BfNodeDynCast<BfUninitializedExpression>(ctorDeclaration->mInitializer->mArguments[0]))
{
if (targetType == mCurTypeInstance)
{
auto thisVariable = GetThisVariable();
if (thisVariable != NULL)
{
thisVariable->mUnassignedFieldFlags = 0;
thisVariable->mIsAssigned = true;
}
}
targetType = NULL;
}
}
if (targetType != NULL)
{
BfAstNode* refNode = methodDeclaration;