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

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/CompoundAssignment.java (+5 lines)
Lines 107-112 Link Here
107
			scope.problemReporter().expressionShouldBeAVariable(this.lhs);
107
			scope.problemReporter().expressionShouldBeAVariable(this.lhs);
108
			return null;
108
			return null;
109
		}
109
		}
110
		boolean expressionIsCast = this.expression instanceof CastExpression;
111
		if (expressionIsCast)
112
			this.expression.bits |= ASTNode.DisableUnnecessaryCastCheck; // will check later on
110
		TypeBinding originalLhsType = this.lhs.resolveType(scope);
113
		TypeBinding originalLhsType = this.lhs.resolveType(scope);
111
		TypeBinding originalExpressionType = this.expression.resolveType(scope);
114
		TypeBinding originalExpressionType = this.expression.resolveType(scope);
112
		if (originalLhsType == null || originalExpressionType == null)
115
		if (originalLhsType == null || originalExpressionType == null)
Lines 181-186 Link Here
181
		this.expression.computeConversion(scope, TypeBinding.wellKnownType(scope, (result >>> 8) & 0x0000F), originalExpressionType);
184
		this.expression.computeConversion(scope, TypeBinding.wellKnownType(scope, (result >>> 8) & 0x0000F), originalExpressionType);
182
		this.preAssignImplicitConversion =  (unboxedLhs ? BOXING : 0) | (lhsID << 4) | (result & 0x0000F);
185
		this.preAssignImplicitConversion =  (unboxedLhs ? BOXING : 0) | (lhsID << 4) | (result & 0x0000F);
183
		if (unboxedLhs) scope.problemReporter().autoboxing(this, lhsType, originalLhsType);
186
		if (unboxedLhs) scope.problemReporter().autoboxing(this, lhsType, originalLhsType);
187
		if (expressionIsCast)
188
			CastExpression.checkNeedForArgumentCasts(scope, this.operator, result, this.lhs, originalLhsType.id, false, this.expression, originalExpressionType.id, true);
184
		return this.resolvedType = originalLhsType;
189
		return this.resolvedType = originalLhsType;
185
	}
190
	}
186
191
(-)src/org/eclipse/jdt/core/tests/compiler/regression/CastTest.java (-1 / +1 lines)
Lines 1719-1725 Link Here
1719
		"3");
1719
		"3");
1720
}
1720
}
1721
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=282869
1721
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=282869
1722
public void _test046() {
1722
public void test046() {
1723
	this.runConformTest(
1723
	this.runConformTest(
1724
		true,
1724
		true,
1725
		new String[] {
1725
		new String[] {

Return to bug 282869