google / google/error-prone

SelfAssignment false positive with casting a float variable to int

Open
#4,437 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
7.2k
Forks
820
Avg merge
5h 9m
Merged PRs (30d)
50

Description

### Description of the problem:

The SelfAssignment checker complains about following:

```java
float width = 123.456f;

width = (int) width;

// value of width is now 123
```

### What version of Error Prone are you using?

2.28.0

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.