Skip to content

Analyzer should warn when patterns are used but not required #50599

@bwilkerson

Description

@bwilkerson

Given the following code:

void f(int x) {
  var (num a) = x;
}

the analyzer should warn that the variable pattern is not required and the code could be rewritten as

void f(int x) {
  num a = x;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2A bug or feature request we're likely to work onarea-devexpFor issues related to the analysis server, IDE support, linter, `dart fix`, and diagnostic messages.devexp-warningIssues with the analyzer's Warning codestype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions