From 4b660b23143d75cc35d44bc252ac0a4c67f7398f Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Sun, 16 Feb 2025 06:45:05 -0800 Subject: [PATCH] Tuple variable initialization fix from splats --- IDEHelper/Compiler/BfStmtEvaluator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/BfStmtEvaluator.cpp b/IDEHelper/Compiler/BfStmtEvaluator.cpp index ff617119..950602e3 100644 --- a/IDEHelper/Compiler/BfStmtEvaluator.cpp +++ b/IDEHelper/Compiler/BfStmtEvaluator.cpp @@ -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;