View | Details | Raw Unified | Return to bug 232558 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java (-12 / +4 lines)
Lines 152-169 Link Here
152
			scope.problemReporter().invalidOperator(this, lhsType, expressionType);
152
			scope.problemReporter().invalidOperator(this, lhsType, expressionType);
153
			return null;
153
			return null;
154
		}
154
		}
155
		if (operator == PLUS){
155
		if (operator == PLUS && ((lhsType.isNumericType() || lhsID == T_boolean) && !expressionType.isNumericType())) {
156
			if(lhsID == T_JavaLangObject) {
156
			// <int | boolean> += <String> is illegal
157
				// <Object> += <String> is illegal (39248)
157
			scope.problemReporter().invalidOperator(this, lhsType, expressionType);
158
				scope.problemReporter().invalidOperator(this, lhsType, expressionType);
158
			return null;
159
				return null;
160
			} else {
161
				// <int | boolean> += <String> is illegal
162
				if ((lhsType.isNumericType() || lhsID == T_boolean) && !expressionType.isNumericType()){
163
					scope.problemReporter().invalidOperator(this, lhsType, expressionType);
164
					return null;
165
				}
166
			}
167
		}
159
		}
168
		this.lhs.computeConversion(scope, TypeBinding.wellKnownType(scope, (result >>> 16) & 0x0000F), originalLhsType);
160
		this.lhs.computeConversion(scope, TypeBinding.wellKnownType(scope, (result >>> 16) & 0x0000F), originalLhsType);
169
		this.expression.computeConversion(scope, TypeBinding.wellKnownType(scope, (result >>> 8) & 0x0000F), originalExpressionType);
161
		this.expression.computeConversion(scope, TypeBinding.wellKnownType(scope, (result >>> 8) & 0x0000F), originalExpressionType);

Return to bug 232558