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:
parent
48e752e95f
commit
dde6a56a03
1 changed files with 18 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue