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

Method ResolveToTypeDef

IDEHelper/Compiler/BfResolvedTypeUtils.cpp:4873–4897  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4871}
4872
4873BfTypeDef* BfResolvedTypeSet::LookupContext::ResolveToTypeDef(BfTypeReference* typeReference, BfType** outType)
4874{
4875 if (outType != NULL)
4876 *outType = NULL;
4877
4878 if (typeReference == mRootTypeRef)
4879 return mRootTypeDef;
4880
4881 if (auto typeDefTypeRef = BfNodeDynCast<BfDirectTypeDefReference>(typeReference))
4882 {
4883 return typeDefTypeRef->mTypeDef;
4884 }
4885
4886 auto type = mModule->ResolveTypeRef(typeReference, BfPopulateType_Identity, BfResolveTypeRefFlag_AllowGenericParamConstValue);
4887 if (type == NULL)
4888 return NULL;
4889 if (outType != NULL)
4890 *outType = type;
4891 if (type->IsPrimitiveType())
4892 return ((BfPrimitiveType*)type)->mTypeDef;
4893 auto typeInst = type->ToTypeInstance();
4894 if (typeInst == NULL)
4895 return NULL;
4896 return typeInst->mTypeDef->GetDefinition();
4897}
4898
4899bool BfResolvedTypeSet::Equals(BfType* lhs, BfTypeReference* rhs, BfTypeDef* rhsTypeDef, LookupContext* ctx)
4900{

Callers 1

EqualsMethod · 0.80

Calls 4

GetDefinitionMethod · 0.80
ResolveTypeRefMethod · 0.45
IsPrimitiveTypeMethod · 0.45
ToTypeInstanceMethod · 0.45

Tested by

no test coverage detected