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

More extern constraints work

This commit is contained in:
Brian Fiete 2020-08-10 17:02:48 -07:00
parent d35ef0e1e8
commit 35505d905a
7 changed files with 34 additions and 10 deletions

View file

@ -209,15 +209,15 @@ void BfMethodMatcher::Init(/*SizedArrayImpl<BfResolvedArg>& arguments, */BfSized
}
bool BfMethodMatcher::IsMemberAccessible(BfTypeInstance* typeInst, BfTypeDef* declaringType)
{
{
if (mActiveTypeDef == NULL)
mActiveTypeDef = mModule->GetActiveTypeDef();
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;
}
@ -931,8 +931,13 @@ void BfMethodMatcher::CompareMethods(BfMethodInstance* prevMethodInstance, BfTyp
auto prevMethodGenericParam = prevMethodInstance->mMethodInfoEx->mGenericParams[genericParamIdx];
SET_BETTER_OR_WORSE(mModule->AreConstraintsSubset(prevMethodGenericParam, newMethodGenericParam), mModule->AreConstraintsSubset(newMethodGenericParam, prevMethodGenericParam));
}
}
if ((!isBetter) && (!isWorse))
{
SET_BETTER_OR_WORSE(newMethodInstance->HasExternConstraints(), prevMethodInstance->HasExternConstraints());
}
}
if ((isBetter) || (isWorse))
{
RETURN_RESULTS;