1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-20 08:58:00 +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

@ -5602,11 +5602,14 @@ BfTypedValue BfExprEvaluator::MatchConstructor(BfAstNode* targetSrc, BfMethodBou
if (!isFailurePass)
{
if (callCtorBodyOnly)
{
if (curTypeDef != targetType->mTypeDef)
{
// We're calling the base class's ctor from a derived class
if (checkProt <= BfProtection_Private)
continue;
}
}
else
{
if (checkProt == BfProtection_Protected) // Treat protected constructors as private

View file

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