diff --git a/IDEHelper/Compiler/BfExprEvaluator.cpp b/IDEHelper/Compiler/BfExprEvaluator.cpp index b526f813..21b9e596 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.cpp +++ b/IDEHelper/Compiler/BfExprEvaluator.cpp @@ -13985,11 +13985,12 @@ BfModuleMethodInstance BfExprEvaluator::GetPropertyMethodInstance(BfMethodDef* m return mModule->GetMethodInstance(propTypeInst, methodDef, BfTypeVector(), mPropGetMethodFlags); } -void BfExprEvaluator::CheckPropFail(BfMethodDef* propMethodDef, BfMethodInstance* methodInstance) +void BfExprEvaluator::CheckPropFail(BfMethodDef* propMethodDef, BfMethodInstance* methodInstance, bool checkProt) { auto propTypeInst = mPropTarget.mType->ToTypeInstance(); // If mExplicitInterface is null then we are implicitly calling through an interface - if ((propTypeInst != NULL) && (methodInstance->GetExplicitInterface() == NULL) && (!mModule->CheckAccessMemberProtection(propMethodDef->mProtection, propTypeInst))) + if ((checkProt) && (propTypeInst != NULL) && (methodInstance->GetExplicitInterface() == NULL) && + (!mModule->CheckAccessMemberProtection(propMethodDef->mProtection, propTypeInst))) mModule->Fail(StrFormat("'%s' is inaccessible due to its protection level", mModule->MethodToString(methodInstance).c_str()), mPropSrc); else if (mPropCheckedKind != methodInstance->mMethodDef->mCheckedKind) { @@ -14069,9 +14070,8 @@ BfTypedValue BfExprEvaluator::GetResult(bool clearResult, bool resolveGenericTyp if (mPropSrc != NULL) mModule->UpdateExprSrcPos(mPropSrc); - - if ((mPropGetMethodFlags & BfGetMethodInstanceFlag_Friend) == 0) - CheckPropFail(matchedMethod, methodInstance.mMethodInstance); + + CheckPropFail(matchedMethod, methodInstance.mMethodInstance, (mPropGetMethodFlags & BfGetMethodInstanceFlag_Friend) == 0); PerformCallChecks(methodInstance.mMethodInstance, mPropSrc); if (methodInstance.mMethodInstance->IsSkipCall()) @@ -14910,8 +14910,8 @@ void BfExprEvaluator::PerformAssignment(BfAssignmentExpression* assignExpr, bool if (methodInstance.mMethodInstance == NULL) return; BF_ASSERT(methodInstance.mMethodInstance->mMethodDef == setMethod); - CheckPropFail(setMethod, methodInstance.mMethodInstance); - + CheckPropFail(setMethod, methodInstance.mMethodInstance, (mPropGetMethodFlags & BfGetMethodInstanceFlag_Friend) == 0); + BfTypedValue convVal; if (binaryOp != BfBinaryOp_None) { diff --git a/IDEHelper/Compiler/BfExprEvaluator.h b/IDEHelper/Compiler/BfExprEvaluator.h index ff97faa5..075c278b 100644 --- a/IDEHelper/Compiler/BfExprEvaluator.h +++ b/IDEHelper/Compiler/BfExprEvaluator.h @@ -329,7 +329,7 @@ public: BfTypedValue ResolveArgValue(BfResolvedArg& resolvedArg, BfType* wantType, BfTypedValue* receivingValue = NULL, BfParamKind paramKind = BfParamKind_Normal); BfMethodDef* GetPropertyMethodDef(BfPropertyDef* propDef, BfMethodType methodType, BfCheckedKind checkedKind); BfModuleMethodInstance GetPropertyMethodInstance(BfMethodDef* methodDef); - void CheckPropFail(BfMethodDef* propMethodDef, BfMethodInstance* methodInstance); + void CheckPropFail(BfMethodDef* propMethodDef, BfMethodInstance* methodInstance, bool checkProt); bool HasResult(); BfTypedValue GetResult(bool clearResult = false, bool resolveGenericType = false); void CheckResultForReading(BfTypedValue& typedValue);