mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Fixed ternary operator with literals without expected type
This commit is contained in:
parent
16e6097dad
commit
705c739750
1 changed files with 2 additions and 0 deletions
|
@ -15703,6 +15703,7 @@ void BfExprEvaluator::Visit(BfConditionalExpression* condExpr)
|
|||
auto checkTrueValue = mModule->Cast(condExpr->mTrueExpression, trueValue, mExpectingType, BfCastFlags_SilentFail);
|
||||
if (checkTrueValue)
|
||||
trueValue = checkTrueValue;
|
||||
mModule->FixIntUnknown(trueValue);
|
||||
}
|
||||
auto trueBlockPos = mModule->mBfIRBuilder->GetInsertBlock();
|
||||
|
||||
|
@ -15714,6 +15715,7 @@ void BfExprEvaluator::Visit(BfConditionalExpression* condExpr)
|
|||
auto checkFalseValue = mModule->Cast(condExpr->mFalseExpression, falseValue, mExpectingType, BfCastFlags_SilentFail);
|
||||
if (checkFalseValue)
|
||||
falseValue = checkFalseValue;
|
||||
mModule->FixIntUnknown(falseValue);
|
||||
}
|
||||
|
||||
bool isValid = trueValue && falseValue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue