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

Fixed dtor lookup

This commit is contained in:
Brian Fiete 2021-02-07 16:17:24 -08:00
parent eddbf7a984
commit 9268e3b25d
6 changed files with 73 additions and 37 deletions

View file

@ -833,12 +833,26 @@ int BfTypeDef::GetSelfGenericParamCount()
BfMethodDef* BfTypeDef::GetMethodByName(const StringImpl& name, int paramCount)
{
for (auto method : mMethods)
{
if ((name == method->mName) && ((paramCount == -1) || (paramCount == (int)method->mParams.size())))
return method;
PopulateMemberSets();
BfMemberSetEntry* entry = NULL;
if (!mMethodSet.TryGetWith(name, &entry))
return NULL;
BfMethodDef* bestMethodDef = NULL;
auto methodDef = (BfMethodDef*)entry->mMemberDef;
while (methodDef != NULL)
{
if ((name == methodDef->mName) && ((paramCount == -1) || (paramCount == (int)methodDef->mParams.size())))
{
if ((bestMethodDef == NULL) ||
((bestMethodDef->mDeclaringType->IsExtension()) && (!methodDef->mDeclaringType->IsExtension())))
bestMethodDef = methodDef;
}
methodDef = methodDef->mNextWithSameName;
}
return NULL;
return bestMethodDef;
}
BfFieldDef* BfTypeDef::GetFieldByName(const StringImpl& name)