1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Fixed [?] in BfSizedArrayCreateExpression (ie: 'int*[?](null, null)')

This commit is contained in:
Brian Fiete 2025-02-15 09:29:08 -08:00
parent 8194f58f59
commit f7b3f88868

View file

@ -11763,7 +11763,7 @@ void BfExprEvaluator::Visit(BfMixinExpression* mixinExpr)
void BfExprEvaluator::Visit(BfSizedArrayCreateExpression* createExpr)
{
auto type = mModule->ResolveTypeRef(createExpr->mTypeRef);
auto type = mModule->ResolveTypeRef(createExpr->mTypeRef, NULL, BfPopulateType_Data, BfResolveTypeRefFlag_AllowInferredSizedArray);
if (type == NULL)
return;
@ -11789,6 +11789,14 @@ void BfExprEvaluator::Visit(BfSizedArrayCreateExpression* createExpr)
return;
}
if (type->IsUndefSizedArray())
{
int arraySize = 0;
if (createExpr->mInitializer != NULL)
arraySize = (int)createExpr->mInitializer->mValues.size();
type = mModule->CreateSizedArrayType(type->GetUnderlyingType(), arraySize);
}
BfSizedArrayType* arrayType = (BfSizedArrayType*)type;
if (createExpr->mInitializer == NULL)