| 4871 | } |
| 4872 | |
| 4873 | BfTypeDef* 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 | |
| 4899 | bool BfResolvedTypeSet::Equals(BfType* lhs, BfTypeReference* rhs, BfTypeDef* rhsTypeDef, LookupContext* ctx) |
| 4900 | { |
no test coverage detected