1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed an issue with primitive type aliases as generic params

This commit is contained in:
Brian Fiete 2020-02-17 10:26:41 -08:00
parent a4d9d5a52f
commit fe531be4ef
2 changed files with 7 additions and 9 deletions

View file

@ -3065,6 +3065,8 @@ BfTypeDef* BfResolvedTypeSet::LookupContext::ResolveToTypeDef(BfTypeReference* t
auto type = mModule->ResolveTypeRef(typeReference, BfPopulateType_Identity, BfResolveTypeRefFlag_AllowGenericParamConstValue);
if (type == NULL)
return NULL;
if (type->IsPrimitiveType())
return ((BfPrimitiveType*)type)->mTypeDef;
auto typeInst = type->ToTypeInstance();
if (typeInst == NULL)
return NULL;
@ -3259,18 +3261,9 @@ bool BfResolvedTypeSet::Equals(BfType* lhs, BfTypeReference* rhs, LookupContext*
return true;
}
if (!rhs->IsTypeDefTypeReference())
return false;
BfPrimitiveType* lhsPrimType = (BfPrimitiveType*)lhs;
auto rhsTypeDef = ctx->ResolveToTypeDef(rhs);
return lhsPrimType->mTypeDef == rhsTypeDef;
// auto rhsTypeDefTypeRef = BfNodeDynCast<BfTypeDefTypeReference>(rhs);
// if (rhsTypeDefTypeRef == NULL)
// return false;
// BfPrimitiveType* lhsPrimType = (BfPrimitiveType*)lhs;
// return lhsPrimType->mTypeDef == rhsTypeDefTypeRef->mTypeDef;
}
else if (lhs->IsPointer())
{