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:
parent
2bbe66cecc
commit
259f50d612
2 changed files with 11 additions and 3 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue