MCPcopy Create free account
hub / github.com/beefytech/Beef / IsMethodImplementedAndReified

Method IsMethodImplementedAndReified

IDEHelper/Compiler/BfModule.cpp:11736–11768  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11734}
11735
11736bool BfModule::IsMethodImplementedAndReified(BfTypeInstance* typeInstance, const StringImpl& methodName, int paramCount, bool checkBase)
11737{
11738 while (typeInstance != NULL)
11739 {
11740 typeInstance->mTypeDef->PopulateMemberSets();
11741 BfMemberSetEntry* entry = NULL;
11742 BfMethodDef* methodDef = NULL;
11743 if (typeInstance->mTypeDef->mMethodSet.TryGetWith(methodName, &entry))
11744 methodDef = (BfMethodDef*)entry->mMemberDef;
11745
11746 while (methodDef != NULL)
11747 {
11748 if ((methodDef->mMethodType != BfMethodType_Mixin) &&
11749 (methodDef->mGenericParams.size() == 0) &&
11750 ((paramCount == -1) || (paramCount == (int)methodDef->mParams.size())))
11751 {
11752 auto& methodInstanceGroup = typeInstance->mMethodInstanceGroups[methodDef->mIdx];
11753 if (!methodInstanceGroup.IsImplemented())
11754 return false;
11755 if (methodInstanceGroup.mDefault == NULL)
11756 return false;
11757 return methodInstanceGroup.mDefault->mIsReified;
11758 }
11759
11760 methodDef = methodDef->mNextWithSameName;
11761 }
11762
11763 if (!checkBase)
11764 break;
11765 typeInstance = typeInstance->mBaseType;
11766 }
11767 return false;
11768}
11769
11770bool BfModule::HasMixin(BfTypeInstance* typeInstance, const StringImpl& methodName, int paramCount, bool checkBase)
11771{

Callers 1

CreateVDataMethod · 0.80

Calls 4

PopulateMemberSetsMethod · 0.80
TryGetWithMethod · 0.80
IsImplementedMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected