Inspectopedia Help

Possibly lossy implicit cast in compound assignment

Reports compound assignments if the type of the right-hand operand is not assignment compatible with the type of the variable.

During such compound assignments, an implicit cast occurs, potentially resulting in lossy conversions.

Example:

long c = 1; c += 1.2;

After the quick-fix is applied:

long c = 1; c += (long) 1.2;

New in 2023.2

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023