| 2804 | } |
| 2805 | |
| 2806 | BfType* 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 | |
| 2842 | bool BfTypeInstance::IsValuelessType() |
| 2843 | { |
no test coverage detected