| 19985 | } |
| 19986 | |
| 19987 | void BfExprEvaluator::CheckPropFail(BfMethodDef* propMethodDef, BfMethodInstance* methodInstance, bool checkProt) |
| 19988 | { |
| 19989 | auto propTypeInst = mPropTarget.mType->ToTypeInstance(); |
| 19990 | // If mExplicitInterface is null then we are implicitly calling through an interface |
| 19991 | if ((checkProt) && (propTypeInst != NULL) && (methodInstance->GetExplicitInterface() == NULL) && |
| 19992 | (!mModule->CheckAccessMemberProtection(propMethodDef->mProtection, propTypeInst))) |
| 19993 | mModule->Fail(StrFormat("'%s' is inaccessible due to its protection level", mModule->MethodToString(methodInstance).c_str()), mPropSrc); |
| 19994 | else if (mPropCheckedKind != methodInstance->mMethodDef->mCheckedKind) |
| 19995 | { |
| 19996 | bool passes = true; |
| 19997 | if (mPropCheckedKind != BfCheckedKind_NotSet) |
| 19998 | { |
| 19999 | passes = false; |
| 20000 | } |
| 20001 | else |
| 20002 | { |
| 20003 | auto defaultCheckedKind = mModule->GetDefaultCheckedKind(); |
| 20004 | if (defaultCheckedKind != methodInstance->mMethodDef->mCheckedKind) |
| 20005 | passes = false; |
| 20006 | } |
| 20007 | if (!passes) |
| 20008 | { |
| 20009 | auto error = mModule->Fail(StrFormat("'%s' cannot be used because its 'checked' specifier does not match the requested specifier", mModule->MethodToString(methodInstance).c_str()), mPropSrc); |
| 20010 | if (error != NULL) |
| 20011 | { |
| 20012 | if ((error != NULL) && (methodInstance->mMethodDef->mMethodDeclaration != NULL)) |
| 20013 | mModule->mCompiler->mPassInstance->MoreInfo(StrFormat("See method declaration"), methodInstance->mMethodDef->GetRefNode()); |
| 20014 | } |
| 20015 | } |
| 20016 | } |
| 20017 | } |
| 20018 | |
| 20019 | bool BfExprEvaluator::HasResult() |
| 20020 | { |
nothing calls this directly
no test coverage detected