Skip to content

proposal: provide_const_constructors #59273

Open
@dleurs

Description

@dleurs

provide_const_constructors

  • Adding const for constructor definition when possible, inside the class
  • Currently prefer_const_constructors only check const when class is called, and so only when constructor definition is already const.

Description

BAD:

class A {
  A();
}

GOOD:

class A {
  const A();
}

Links :

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestarea-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-lint-proposallinter-set-flutterlinter-status-pendingtype-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