Skip to content

Encourage the use of initializing formal parameters #58847

@bwilkerson

Description

@bwilkerson

Similar to the use_super_parameters rule, there could be a rule to encourage the use of an initializing formal parameter when the parameter is assigned, unmodified, to a field with the same name as the parameter. For example:

class C {
  int field;

  C({required int field}) : field = field; // Should use 'this.field'.
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestdevexp-linterIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions