1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Improved mid-compile deleted type handling

This commit is contained in:
Brian Fiete 2025-02-23 08:08:13 -08:00
parent 188ff74128
commit 4ba8f6b0f6
5 changed files with 39 additions and 5 deletions

View file

@ -9508,8 +9508,14 @@ BfTypedValue BfExprEvaluator::CheckEnumCreation(BfAstNode* targetSrc, BfTypeInst
BfTypedValue receivingValue;
BfIRValue tupleFieldPtr;
if (tuplePtr)
mModule->PopulateType(tupleFieldInstance->mResolvedType);
if (tupleFieldInstance->mResolvedType->IsValuelessType())
{
receivingValue = mModule->GetDefaultTypedValue(tupleFieldInstance->mResolvedType);
}
else if (tuplePtr)
{
tupleFieldPtr = mModule->mBfIRBuilder->CreateInBoundsGEP(tuplePtr, 0, tupleFieldInstance->mDataIdx);
receivingValue = BfTypedValue(tupleFieldPtr, tupleFieldInstance->mResolvedType, true);
}