mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed inferred FromEnd index value
This commit is contained in:
parent
9f9f9b0364
commit
fdcfba8bad
1 changed files with 5 additions and 2 deletions
|
@ -20904,7 +20904,10 @@ void BfExprEvaluator::PerformBinaryOperation(BfExpression* leftExpression, BfExp
|
|||
auto indexType = mModule->ResolveTypeDef(mModule->mCompiler->mIndexTypeDef)->ToTypeInstance();
|
||||
rightTypedValueExpr.mRefNode = opToken;
|
||||
|
||||
auto valueTypeEmpty = mModule->mBfIRBuilder->CreateConstAgg(mModule->mBfIRBuilder->MapType(indexType->mBaseType), {});
|
||||
auto valueTypeEmpty = mModule->mBfIRBuilder->CreateConstAgg(mModule->mBfIRBuilder->MapType(indexType->mBaseType->mBaseType), {});
|
||||
SizedArray<BfIRValue, 8> enumMembers;
|
||||
enumMembers.Add(valueTypeEmpty);
|
||||
auto enumValue = mModule->mBfIRBuilder->CreateConstAgg(mModule->mBfIRBuilder->MapType(indexType->mBaseType), enumMembers);
|
||||
|
||||
SizedArray<BfIRValue, 8> tupleMembers;
|
||||
tupleMembers.Add(valueTypeEmpty);
|
||||
|
@ -20912,7 +20915,7 @@ void BfExprEvaluator::PerformBinaryOperation(BfExpression* leftExpression, BfExp
|
|||
auto tupleValue = mModule->mBfIRBuilder->CreateConstAgg(mModule->mBfIRBuilder->MapType(indexType->mFieldInstances[0].mResolvedType), tupleMembers);
|
||||
|
||||
SizedArray<BfIRValue, 8> indexMembers;
|
||||
indexMembers.Add(valueTypeEmpty);
|
||||
indexMembers.Add(enumValue);
|
||||
indexMembers.Add(tupleValue);
|
||||
indexMembers.Add(mModule->mBfIRBuilder->CreateConst(BfTypeCode_Int8, 1));
|
||||
auto indexValue = mModule->mBfIRBuilder->CreateConstAgg(mModule->mBfIRBuilder->MapType(indexType), indexMembers);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue