-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix UnusedVariable false positives for private record parameters
Fixes #2713 It looks like the tree emitted by the compiler is incomplete for the canonical constructor of a record, which is why the parameters were erroneously flagged as unused. Apparently this only affected `private` record classes because for them the implicit canonical constructor is `private` as well, and the `UnusedVariable` check treats parameters of `private` methods and constructors differently. #2713 (comment) showed an example where this also affected record fields, however I was unable to reproduce that. Maybe they were using an older Error Prone version which does not include 47da3af, their sample code is incomplete, or my test setup was incorrect. Edit: It looks like they were using an older Error Prone version, see #2713 (comment). Fixes #3837 COPYBARA_INTEGRATE_REVIEW=#3837 from Marcono1234:record-unused-param-false-positives 4535778 PiperOrigin-RevId: 557914152
- Loading branch information
1 parent
1b1ef67
commit 24065a9
Showing
2 changed files
with
106 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters