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

Method IsTypeMemberIncluded

IDEHelper/Compiler/BfResolvedTypeUtils.cpp:2733–2779  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2731}
2732
2733bool BfTypeInstance::IsTypeMemberIncluded(BfTypeDef* typeDef, BfTypeDef* activeTypeDef, BfModule* module)
2734{
2735 if (mGenericTypeInfo == NULL)
2736 return true;
2737 if (mGenericTypeInfo->mGenericExtensionInfo == NULL)
2738 return true;
2739 if ((typeDef == NULL) || (typeDef == activeTypeDef))
2740 return true;
2741
2742 // The combined type declaration is the root type declaration, it's implicitly included
2743 if (typeDef->mTypeDeclaration == mTypeDef->mTypeDeclaration)
2744 return true;
2745
2746 BfGenericExtensionEntry* genericExEntry = NULL;
2747 if (!mGenericTypeInfo->mGenericExtensionInfo->mExtensionMap.TryGetValue(typeDef, &genericExEntry))
2748 return true;
2749
2750 if (mGenericTypeInfo->mIsUnspecialized)
2751 {
2752 if (module == NULL)
2753 return true; // During population
2754
2755 auto declConstraints = &genericExEntry->mGenericParams;
2756
2757 for (int genericIdx = 0; genericIdx < (int)declConstraints->size(); genericIdx++)
2758 {
2759 auto declGenericParam = (*declConstraints)[genericIdx];
2760
2761 BfType* genericArg;
2762 if (genericIdx < (int)mGenericTypeInfo->mTypeGenericArguments.size())
2763 {
2764 genericArg = mGenericTypeInfo->mTypeGenericArguments[genericIdx];
2765 }
2766 else
2767 {
2768 genericArg = declGenericParam->mExternType;
2769 }
2770
2771 if ((genericArg == NULL) || (!module->CheckGenericConstraints(BfGenericParamSource(), genericArg, NULL, declGenericParam)))
2772 return false;
2773 }
2774
2775 return true;
2776 }
2777
2778 return genericExEntry->mConstraintsPassed;
2779}
2780
2781bool BfTypeInstance::IsZeroGap()
2782{

Callers 15

TryCaseEnumMatchMethod · 0.45
HandleCaseBindMethod · 0.45
GetMethodInstanceMethod · 0.45
SlotVirtualMethodMethod · 0.45
AddTypeMembersMethod · 0.45
AddEnumTypeMembersMethod · 0.45
CheckInterfaceFixitMethod · 0.45
CheckMemberNamesMethod · 0.45
HandleCEAttributesMethod · 0.45
ExecuteCEOnCompileMethod · 0.45

Calls 4

TryGetValueMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected