From 9ffdb9474057813ee8288eed07a4676a4dbd7696 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Wed, 19 Feb 2020 06:55:06 -0800 Subject: [PATCH] Fix for calling private ctor from another ctor within the current type --- IDEHelper/Compiler/BfExprEvaluator.cpp | 9 ++++++--- IDEHelper/Compiler/BfModule.cpp | 5 ----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index 626d2850..4c00c14c 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -5603,9 +5603,12 @@ BfTypedValue BfExprEvaluator::MatchConstructor(BfAstNode* targetSrc, BfMethodBou { if (callCtorBodyOnly) { - // We're calling the base class's ctor from a derived class - if (checkProt <= BfProtection_Private) - continue; + if (curTypeDef != targetType->mTypeDef) + { + // We're calling the base class's ctor from a derived class + if (checkProt <= BfProtection_Private) + continue; + } } else { diff --git a/IDEHelper/Compiler/BfModule.cpp b/IDEHelper/Compiler/BfModule.cpp index 02f52cfe..022acb91 100644 --- a/IDEHelper/Compiler/BfModule.cpp +++ b/IDEHelper/Compiler/BfModule.cpp @@ -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;