1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 20:12:21 +02:00

Handle methodGenericArg dep for IsSpecializedByAutoCompleteMethod

This commit is contained in:
Brian Fiete 2022-08-26 06:02:07 -07:00
parent ae8ea6281d
commit c04d240210
2 changed files with 26 additions and 22 deletions

View file

@ -2991,6 +2991,8 @@ void BfMethodMatcher::TryDevirtualizeCall(BfTypedValue target, BfTypedValue* ori
while (checkTypeInst != NULL) while (checkTypeInst != NULL)
{ {
mModule->PopulateType(checkTypeInst, BfPopulateType_DataAndMethods); mModule->PopulateType(checkTypeInst, BfPopulateType_DataAndMethods);
if (checkTypeInst->mDefineState >= BfTypeDefineState_DefinedAndMethodsSlotted)
{
for (auto&& iface : checkTypeInst->mInterfaces) for (auto&& iface : checkTypeInst->mInterfaces)
{ {
//TODO: Why did we have this check? This caused Dictionary to not be able to devirtualize //TODO: Why did we have this check? This caused Dictionary to not be able to devirtualize
@ -3020,6 +3022,7 @@ void BfMethodMatcher::TryDevirtualizeCall(BfTypedValue target, BfTypedValue* ori
} }
} }
} }
}
if (bestIFaceEntry != NULL) if (bestIFaceEntry != NULL)
break; break;

View file

@ -3597,7 +3597,8 @@ void BfModule::AddDependency(BfType* usedType, BfType* userType, BfDependencyMap
if (usedType->IsSpecializedByAutoCompleteMethod()) if (usedType->IsSpecializedByAutoCompleteMethod())
{ {
if ((flags & (BfDependencyMap::DependencyFlag_TypeGenericArg | BfDependencyMap::DependencyFlag_OuterType | BfDependencyMap::DependencyFlag_DerivedFrom)) == 0) if ((flags & (BfDependencyMap::DependencyFlag_TypeGenericArg | BfDependencyMap::DependencyFlag_MethodGenericArg |
BfDependencyMap::DependencyFlag_OuterType | BfDependencyMap::DependencyFlag_DerivedFrom)) == 0)
return; return;
} }