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

Method GetOuterType

IDEHelper/Compiler/BfModuleTypeUtils.cpp:8802–8833  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8800}
8801
8802BfTypeInstance* BfModule::GetOuterType(BfType* type)
8803{
8804 if (type == NULL)
8805 return NULL;
8806 if (type->IsBoxed())
8807 return GetOuterType(((BfBoxedType*)type)->mElementType);
8808 auto typeInst = type->ToTypeInstance();
8809 if ((typeInst == NULL) || (typeInst->mTypeDef->mOuterType == NULL))
8810 return NULL;
8811 auto outerTypeDef = typeInst->mTypeDef->mOuterType;
8812 if (outerTypeDef->mIsPartial)
8813 {
8814 outerTypeDef = GetCombinedPartialTypeDef(outerTypeDef);
8815 if (outerTypeDef == NULL)
8816 return NULL;
8817 }
8818
8819 BfTypeVector typeGenericArguments;
8820 if (type->IsGenericTypeInstance())
8821 {
8822 auto genericType = (BfTypeInstance*)type;
8823 typeGenericArguments = genericType->mGenericTypeInfo->mTypeGenericArguments;
8824 }
8825 BF_ASSERT((intptr)typeGenericArguments.size() >= (intptr)outerTypeDef->mGenericParamDefs.size());
8826 typeGenericArguments.resize(outerTypeDef->mGenericParamDefs.size());
8827
8828 //auto outerType = ResolveTypeDef(outerTypeDef, typeGenericArguments, BfPopulateType_Declaration);
8829 auto outerType = ResolveTypeDef(outerTypeDef, typeGenericArguments, BfPopulateType_Identity);
8830 if (outerType == NULL)
8831 return NULL;
8832 return outerType->ToTypeInstance();
8833}
8834
8835bool BfModule::IsInnerType(BfType* checkInnerType, BfType* checkOuterType)
8836{

Callers 15

CreateTypeDataMethod · 0.80
GetReflectKindMethod · 0.80
AddCurrentTypesMethod · 0.80
AddTypeMembersMethod · 0.80
CheckMemberReferenceMethod · 0.80
CreateTypeDeclarationMethod · 0.80
FindOrCreateNameSubMethod · 0.80
MangleMethod · 0.80
CheckTypeMethod · 0.80

Calls 5

IsBoxedMethod · 0.45
ToTypeInstanceMethod · 0.45
IsGenericTypeInstanceMethod · 0.45
sizeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected