Skip to content

enhance prefer_const_literals_to_create_immutables to lint constructor tear-off invocations #58504

@pq

Description

@pq

Test case:

@immutable
class A {
  const A(a);
}

void constructorTearOffs() {
  var makeA = A.new;
  var l1 = makeA([]); // LINT
  var l2 = makeA(const[]); // OK
}

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-linterIssues with the analyzer's support for the linter packagelinter-false-negativeIssues related to lint rules that fail to report a problem.linter-new-language-featurelinter-set-fluttertype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions