1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

Fixed autoprop backing field access

This commit is contained in:
Brian Fiete 2022-04-26 07:36:33 -07:00
parent 2bbe66cecc
commit 259f50d612
2 changed files with 11 additions and 3 deletions

View file

@ -5291,9 +5291,15 @@ BfTypedValue BfExprEvaluator::LookupField(BfAstNode* targetSrc, BfTypedValue tar
auto field = nextField; auto field = nextField;
nextField = nextField->mNextWithSameName; nextField = nextField->mNextWithSameName;
auto checkProtection = field->mProtection;
if (checkProtection == BfProtection_Hidden)
{
// Allow acessing hidden fields
checkProtection = BfProtection_Private;
}
if (((flags & BfLookupFieldFlag_IgnoreProtection) == 0) && (!isFailurePass) && if (((flags & BfLookupFieldFlag_IgnoreProtection) == 0) && (!isFailurePass) &&
(!mModule->CheckProtection(protectionCheckFlags, curCheckType, field->mDeclaringType->mProject, field->mProtection, startCheckType))) (!mModule->CheckProtection(protectionCheckFlags, curCheckType, field->mDeclaringType->mProject, checkProtection, startCheckType)))
{ {
continue; continue;
} }

View file

@ -2752,7 +2752,9 @@ void BfModule::GetAccessAllowed(BfTypeInstance* checkType, bool &allowProtected,
} }
bool BfModule::CheckProtection(BfProtectionCheckFlags& flags, BfTypeInstance* memberOwner, BfProject* memberProject, BfProtection memberProtection, BfTypeInstance* lookupStartType) bool BfModule::CheckProtection(BfProtectionCheckFlags& flags, BfTypeInstance* memberOwner, BfProject* memberProject, BfProtection memberProtection, BfTypeInstance* lookupStartType)
{ {
if (memberProtection == BfProtection_Hidden)
return false;
if (memberProtection == BfProtection_Public) if (memberProtection == BfProtection_Public)
return true; return true;