| 11590 | } |
| 11591 | |
| 11592 | BfModuleMethodInstance BfModule::GetMethodByName(BfTypeInstance* typeInstance, const StringImpl& methodName, int paramCount, bool checkBase) |
| 11593 | { |
| 11594 | PopulateType(typeInstance, BfPopulateType_DataAndMethods); |
| 11595 | |
| 11596 | while (typeInstance != NULL) |
| 11597 | { |
| 11598 | typeInstance->mTypeDef->PopulateMemberSets(); |
| 11599 | BfMemberSetEntry* entry = NULL; |
| 11600 | BfMethodDef* methodDef = NULL; |
| 11601 | if (typeInstance->mTypeDef->mMethodSet.TryGetWith(methodName, &entry)) |
| 11602 | methodDef = (BfMethodDef*)entry->mMemberDef; |
| 11603 | |
| 11604 | while (methodDef != NULL) |
| 11605 | { |
| 11606 | if ((methodDef->mMethodType != BfMethodType_Mixin) && |
| 11607 | (methodDef->mGenericParams.size() == 0) && |
| 11608 | ((paramCount == -1) || (paramCount == (int)methodDef->mParams.size()))) |
| 11609 | { |
| 11610 | auto moduleMethodInstance = GetMethodInstanceAtIdx(typeInstance, methodDef->mIdx); |
| 11611 | if (moduleMethodInstance) |
| 11612 | return moduleMethodInstance; |
| 11613 | } |
| 11614 | methodDef = methodDef->mNextWithSameName; |
| 11615 | } |
| 11616 | |
| 11617 | if (!checkBase) |
| 11618 | break; |
| 11619 | typeInstance = typeInstance->mBaseType; |
| 11620 | } |
| 11621 | return BfModuleMethodInstance(); |
| 11622 | } |
| 11623 | |
| 11624 | BfModuleMethodInstance BfModule::GetMethodByName(BfTypeInstance* typeInstance, const StringImpl& methodName, const Array<BfType*>& paramTypes, bool checkBase) |
| 11625 | { |
no test coverage detected