Skip to content

Commit 4b2f77c

Browse files
committed
Add comment
1 parent 11a39c5 commit 4b2f77c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

framework/src/main/java/org/checkerframework/framework/util/JavaExpressionParseUtil.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,8 @@ public JavaExpression visit(BinaryExpr expr, Void aVoid) {
954954
// isSubtype() first does the cheaper test isSameType(), so no need to do it here.
955955
if (expr.getOperator() == BinaryExpr.Operator.PLUS
956956
&& (TypesUtils.isString(leftType) || TypesUtils.isString(rightType))) {
957+
// JLS 15.18.1 says, "If only one operand expression is of type String, then string
958+
// conversion is performed on the other operand to produce a string at run time."
957959
type = stringTypeMirror;
958960
} else if (types.isSubtype(leftType, rightType)) {
959961
type = rightType;

0 commit comments

Comments
 (0)