mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
Allow private member access in initializer block when subclassing
This commit is contained in:
parent
40a9dbf25c
commit
971cecdd99
3 changed files with 35 additions and 36 deletions
|
@ -2884,6 +2884,9 @@ void BfModule::GetAccessAllowed(BfTypeInstance* checkType, bool &allowProtected,
|
|||
|
||||
bool BfModule::CheckProtection(BfProtectionCheckFlags& flags, BfTypeInstance* memberOwner, BfProject* memberProject, BfProtection memberProtection, BfTypeInstance* lookupStartType)
|
||||
{
|
||||
if ((memberOwner != NULL) && (mCurMethodState != NULL) && (mCurMethodState->mPrivateTypeInstance == memberOwner))
|
||||
return true;
|
||||
|
||||
if (memberProtection == BfProtection_Hidden)
|
||||
return false;
|
||||
if (memberProtection == BfProtection_Public)
|
||||
|
@ -22233,6 +22236,7 @@ void BfModule::ProcessMethod(BfMethodInstance* methodInstance, bool isInlineDup,
|
|||
mCurMethodState->mHeadScope.mAstBlock = bodyBlock;
|
||||
mCurMethodState->mHeadScope.mCloseNode = bodyBlock->mCloseBrace;
|
||||
VisitCodeBlock(bodyBlock);
|
||||
BF_ASSERT(mCurMethodState->mCurScope == &mCurMethodState->mHeadScope);
|
||||
}
|
||||
else if (auto expressionBody = BfNodeDynCast<BfExpression>(methodDef->mBody))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue