baldimir commented on code in PR #5761:
URL: 
https://github.com/apache/incubator-kie-drools/pull/5761#discussion_r1512624566


##########
drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/generator/expressiontyper/ExpressionTyper.java:
##########
@@ -224,16 +225,19 @@ private Optional<TypedExpression> 
toTypedExpressionRec(Expression drlxExpr) {
             TypedExpression left = optLeft.get();
             TypedExpression right = optRight.get();
 
-            ArithmeticCoercedExpression.ArithmeticCoercedExpressionResult 
coerced;
-            try {
-                coerced = new ArithmeticCoercedExpression(left, right, 
operator).coerce();
-            } catch 
(ArithmeticCoercedExpression.ArithmeticCoercedExpressionException e) {
-                logger.error("Failed to coerce : {}", 
e.getInvalidExpressionErrorResult());
-                return empty();
-            }
+            // Can be a binary expression of non-numeric types, like String + 
customType, etc.
+            if (ClassUtils.isNumericClass(left.getRawClass()) || 
ClassUtils.isNumericClass(right.getRawClass())) {

Review Comment:
   This is just a check to find out if one of the inputs is a number. Other 
type checks are within the ArithmeticCoercedExpression. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to