Skip to content

unused_local_variable false negative: Report unused destructured variables #61051

Open
@rrousselGit

Description

@rrousselGit

Consider:

final [a, b] = [1,2];

print(b);

a is unused but not reported as such. It should be reported as unused, and the fix should be:

final [_, b] = [1,2];

print(b);

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions