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

Fixed type population with Span params

This commit is contained in:
Brian Fiete 2022-05-04 07:58:00 -07:00
parent 0df06b9870
commit 0c955e5c66

View file

@ -7481,9 +7481,11 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, const BfTypedValu
}
else if (wantType->IsInstanceOf(mModule->mCompiler->mSpanTypeDef))
{
mModule->PopulateType(wantType);
mModule->mBfIRBuilder->PopulateType(wantType);
auto genericTypeInst = wantType->ToGenericTypeInstance();
expandedParamsElementType = genericTypeInst->mGenericTypeInfo->mTypeGenericArguments[0];
expandedParamsArray = BfTypedValue(mModule->CreateAlloca(wantType), wantType, true);
expandedParamAlloca = mModule->CreateAlloca(genericTypeInst->mGenericTypeInfo->mTypeGenericArguments[0], true, NULL, mModule->GetConstValue(numElements));
mModule->mBfIRBuilder->CreateAlignedStore(expandedParamAlloca, mModule->mBfIRBuilder->CreateInBoundsGEP(expandedParamsArray.mValue, 0, 1), mModule->mSystem->mPtrSize);
@ -7494,6 +7496,8 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, const BfTypedValu
}
else if (wantType->IsSizedArray())
{
mModule->PopulateType(wantType);
mModule->mBfIRBuilder->PopulateType(wantType);
BfSizedArrayType* sizedArrayType = (BfSizedArrayType*)wantType;
expandedParamsElementType = wantType->GetUnderlyingType();