Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UnusedVariable false positives for private record parameters #4049

Closed
wants to merge 1 commit into from

Commits on Aug 15, 2023

  1. 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
    
    FUTURE_COPYBARA_INTEGRATE_REVIEW=#3837 from Marcono1234:record-unused-param-false-positives 4535778
    PiperOrigin-RevId: 557194050
    Marcono1234 authored and Error Prone Team committed Aug 15, 2023
    Configuration menu
    Copy the full SHA
    bb85816 View commit details
    Browse the repository at this point in the history