1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Properly check for IsMemberAccessible for operators

This commit is contained in:
Brian Fiete 2020-08-13 16:19:22 -07:00
parent fe4027d33a
commit 1dc1ec24a0

View file

@ -213,11 +213,13 @@ bool BfMethodMatcher::IsMemberAccessible(BfTypeInstance* typeInst, BfTypeDef* de
if (mActiveTypeDef == NULL)
mActiveTypeDef = mModule->GetActiveTypeDef();
// This needs to be outside the `IsInSpecializedSection`. Note that mActiveTypeDef does not pose a constraint here
if (!typeInst->IsTypeMemberIncluded(declaringType, mActiveTypeDef, mModule))
return false;
// This may not be completely correct - BUT if we don't have this then even Dictionary TKey's operator == won't be considered accessible
if ((!mModule->IsInSpecializedSection()) && (mActiveTypeDef->mTypeDeclaration != NULL))
{
if (!typeInst->IsTypeMemberIncluded(declaringType, mActiveTypeDef, mModule))
return false;
{
if (!typeInst->IsTypeMemberAccessible(declaringType, mActiveTypeDef))
return false;
}