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

Fixed constant string adding

This commit is contained in:
Brian Fiete 2020-12-24 12:37:54 -08:00
parent cad0b10aae
commit 90d4b84d95

View file

@ -20002,6 +20002,13 @@ void BfExprEvaluator::PerformBinaryOperation(BfAstNode* leftExpression, BfAstNod
}
}
if ((binaryOp == BfBinaryOp_Add) && (resultType->IsInstanceOf(mModule->mCompiler->mStringTypeDef)))
{
// Allow failover to constant string addition
if ((leftValue.mValue.IsConst()) && (rightValue.mValue.IsConst()))
skipOpOverload = true;
}
if (!skipOpOverload)
{
BfBinaryOp findBinaryOp = binaryOp;