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

Error for invalid use of inferred-sized arrays

This commit is contained in:
Brian Fiete 2021-07-19 08:19:50 -07:00
parent 5929dbb6cb
commit f4b2d58273
5 changed files with 13 additions and 5 deletions

View file

@ -3259,6 +3259,10 @@ int BfResolvedTypeSet::DoHash(BfTypeReference* typeRef, LookupContext* ctx, BfHa
else if (constant->mConstType == BfConstType_Undef)
{
elementCount = -1; // Marker for undef
if ((ctx->mResolveFlags & BfResolveTypeRefFlag_AllowUnknownSizedArray) == 0)
{
ctx->mModule->Fail("Invalid use of inferred-sized array", sizeExpr);
}
}
else
{