mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Handle methodGenericArg dep for IsSpecializedByAutoCompleteMethod
This commit is contained in:
parent
ae8ea6281d
commit
c04d240210
2 changed files with 26 additions and 22 deletions
|
@ -2991,32 +2991,35 @@ void BfMethodMatcher::TryDevirtualizeCall(BfTypedValue target, BfTypedValue* ori
|
|||
while (checkTypeInst != NULL)
|
||||
{
|
||||
mModule->PopulateType(checkTypeInst, BfPopulateType_DataAndMethods);
|
||||
for (auto&& iface : checkTypeInst->mInterfaces)
|
||||
if (checkTypeInst->mDefineState >= BfTypeDefineState_DefinedAndMethodsSlotted)
|
||||
{
|
||||
//TODO: Why did we have this check? This caused Dictionary to not be able to devirtualize
|
||||
// calls to TKey GetHashCode when TKey was from a user's project...
|
||||
/*if (!checkTypeInst->IsTypeMemberAccessible(iface.mDeclaringType, activeTypeDef))
|
||||
continue;*/
|
||||
|
||||
if (iface.mInterfaceType == mBestMethodTypeInstance)
|
||||
for (auto&& iface : checkTypeInst->mInterfaces)
|
||||
{
|
||||
if (bestIFaceEntry == NULL)
|
||||
{
|
||||
bestIFaceEntry = &iface;
|
||||
continue;
|
||||
}
|
||||
//TODO: Why did we have this check? This caused Dictionary to not be able to devirtualize
|
||||
// calls to TKey GetHashCode when TKey was from a user's project...
|
||||
/*if (!checkTypeInst->IsTypeMemberAccessible(iface.mDeclaringType, activeTypeDef))
|
||||
continue;*/
|
||||
|
||||
bool isBetter;
|
||||
bool isWorse;
|
||||
mModule->CompareDeclTypes(NULL, iface.mDeclaringType, bestIFaceEntry->mDeclaringType, isBetter, isWorse);
|
||||
if (isBetter == isWorse)
|
||||
if (iface.mInterfaceType == mBestMethodTypeInstance)
|
||||
{
|
||||
// Failed
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isBetter)
|
||||
if (bestIFaceEntry == NULL)
|
||||
{
|
||||
bestIFaceEntry = &iface;
|
||||
continue;
|
||||
}
|
||||
|
||||
bool isBetter;
|
||||
bool isWorse;
|
||||
mModule->CompareDeclTypes(NULL, iface.mDeclaringType, bestIFaceEntry->mDeclaringType, isBetter, isWorse);
|
||||
if (isBetter == isWorse)
|
||||
{
|
||||
// Failed
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isBetter)
|
||||
bestIFaceEntry = &iface;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue