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

Tuple variable initialization fix from splats

This commit is contained in:
Brian Fiete 2025-02-16 06:45:05 -08:00
parent b1181a936d
commit 4b660b2314

View file

@ -2175,6 +2175,7 @@ void BfModule::HandleTupleVariableDeclaration(BfVariableDeclaration* varDecl, Bf
initTupleType = (BfTypeInstance*)initTupleValue.mType;
CheckTupleVariableDeclaration(tupleExpr, initTupleValue.mType);
mBfIRBuilder->PopulateType(initTupleValue.mType);
for (int varIdx = 0; varIdx < (int)tupleExpr->mValues.size(); varIdx++)
{
@ -2193,7 +2194,7 @@ void BfModule::HandleTupleVariableDeclaration(BfVariableDeclaration* varDecl, Bf
initValue = LoadValue(initValue);
}
else
initValue = BfTypedValue(mBfIRBuilder->CreateExtractValue(initTupleValue.mValue, fieldInstance->mDataIdx), resolvedType);
initValue = ExtractValue(initTupleValue, fieldInstance, fieldInstance->mDataIdx);
}
BfTupleNameNode* tupleNameNode = NULL;