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

Method GetUnderlyingType

IDEHelper/Compiler/BfResolvedTypeUtils.cpp:2806–2840  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2804}
2805
2806BfType* BfTypeInstance::GetUnderlyingType()
2807{
2808 if (!mIsTypedPrimitive)
2809 {
2810 if ((mGenericTypeInfo != NULL) && (!mGenericTypeInfo->mTypeGenericArguments.IsEmpty()))
2811 return mGenericTypeInfo->mTypeGenericArguments[0];
2812 return NULL;
2813 }
2814
2815 if (mTypeInfoEx == NULL)
2816 mTypeInfoEx = new BfTypeInfoEx();
2817 if (mTypeInfoEx->mUnderlyingType != NULL)
2818 return mTypeInfoEx->mUnderlyingType;
2819
2820 auto checkTypeInst = this;
2821 while (checkTypeInst != NULL)
2822 {
2823 if (!checkTypeInst->mFieldInstances.empty())
2824 {
2825 auto& lastField = checkTypeInst->mFieldInstances.back();
2826 if (lastField.mFieldIdx == -1)
2827 {
2828 auto underlyingType = lastField.mResolvedType;
2829 BF_ASSERT(underlyingType != this);
2830 mTypeInfoEx->mUnderlyingType = underlyingType;
2831 return mTypeInfoEx->mUnderlyingType;
2832 }
2833 }
2834 checkTypeInst = checkTypeInst->mBaseType;
2835 if ((checkTypeInst != NULL) && (checkTypeInst->IsIncomplete()))
2836 mModule->PopulateType(checkTypeInst, BfPopulateType_Data);
2837 }
2838 //BF_FATAL("Failed");
2839 return mTypeInfoEx->mUnderlyingType;
2840}
2841
2842bool BfTypeInstance::IsValuelessType()
2843{

Callers 15

VisitMethod · 0.45
DoForLessMethod · 0.45
InitMethod · 0.45
DoObjectCreateMethod · 0.45
GetConstValueMethod · 0.45
GetDefaultValueMethod · 0.45
GetDefaultTypedValueMethod · 0.45
GetVisibleProjectSetMethod · 0.45
AddDependencyMethod · 0.45
CreateStaticFieldMethod · 0.45

Calls 5

IsEmptyMethod · 0.45
emptyMethod · 0.45
backMethod · 0.45
IsIncompleteMethod · 0.45
PopulateTypeMethod · 0.45

Tested by

no test coverage detected