1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-21 09:27:59 +02:00

Fix for calling private ctor from another ctor within the current type

This commit is contained in:
Brian Fiete 2020-02-19 06:55:06 -08:00
parent f041caaeb8
commit 9ffdb94740
2 changed files with 6 additions and 8 deletions

View file

@ -5603,9 +5603,12 @@ BfTypedValue BfExprEvaluator::MatchConstructor(BfAstNode* targetSrc, BfMethodBou
{ {
if (callCtorBodyOnly) if (callCtorBodyOnly)
{ {
// We're calling the base class's ctor from a derived class if (curTypeDef != targetType->mTypeDef)
if (checkProt <= BfProtection_Private) {
continue; // We're calling the base class's ctor from a derived class
if (checkProt <= BfProtection_Private)
continue;
}
} }
else else
{ {

View file

@ -14219,11 +14219,6 @@ void BfModule::EmitCtorBody(bool& skipBody)
} }
} }
if (mCurTypeInstance->IsDelegate())
{
NOP;
}
BfAstNode* baseCtorNode = NULL; BfAstNode* baseCtorNode = NULL;
if ((ctorDeclaration != NULL) && (ctorDeclaration->mInitializer != NULL) && (ctorDeclaration->mInitializer->mTarget != NULL)) if ((ctorDeclaration != NULL) && (ctorDeclaration->mInitializer != NULL) && (ctorDeclaration->mInitializer->mTarget != NULL))
baseCtorNode = ctorDeclaration->mInitializer->mTarget; baseCtorNode = ctorDeclaration->mInitializer->mTarget;