1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

Fixed array lookup

This commit is contained in:
Brian Fiete 2020-04-02 08:56:45 -07:00
parent ca814fe695
commit 67dadf34e5

View file

@ -3139,8 +3139,16 @@ bool BfResolvedTypeSet::Equals(BfType* lhs, BfTypeReference* rhs, LookupContext*
auto rhsArrayTypeRef = BfNodeDynCastExact<BfArrayTypeRef>(rhs);
if (rhsArrayTypeRef == NULL)
return false;
if (!rhsArrayTypeRef->mParams.IsEmpty())
return false;
// Any non-comma param means it's a sized array
for (auto param : rhsArrayTypeRef->mParams)
{
bool isComma = false;
if (auto tokenNode = BfNodeDynCast<BfTokenNode>(param))
isComma = tokenNode->mToken == BfToken_Comma;
if (!isComma)
return false;
}
BfArrayType* lhsArrayType = (BfArrayType*) lhs;
if (lhsArrayType->mDimensions != rhsArrayTypeRef->mDimensions)
return false;