Parcourir la source

Fixed constant string adding

Brian Fiete il y a 4 ans
Parent
commit
90d4b84d95
1 fichiers modifiés avec 7 ajouts et 0 suppressions
  1. 7 0
      IDEHelper/Compiler/BfExprEvaluator.cpp

+ 7 - 0
IDEHelper/Compiler/BfExprEvaluator.cpp

@@ -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)
 		if (!skipOpOverload)
 		{
 		{
 			BfBinaryOp findBinaryOp = binaryOp;
 			BfBinaryOp findBinaryOp = binaryOp;