Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mernst committed Jan 2, 2025
1 parent 11a39c5 commit 4b2f77c
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -954,6 +954,8 @@ public JavaExpression visit(BinaryExpr expr, Void aVoid) {
// isSubtype() first does the cheaper test isSameType(), so no need to do it here.
if (expr.getOperator() == BinaryExpr.Operator.PLUS
&& (TypesUtils.isString(leftType) || TypesUtils.isString(rightType))) {
// JLS 15.18.1 says, "If only one operand expression is of type String, then string
// conversion is performed on the other operand to produce a string at run time."
type = stringTypeMirror;
} else if (types.isSubtype(leftType, rightType)) {
type = rightType;
Expand Down

0 comments on commit 4b2f77c

Please sign in to comment.