Skip to content

Lint for type annotated formal initializers (Style Guide) #57157

@pq

Description

@pq

From the style guide:

DON’T type annotate initializing formals.

If a constructor parameter is using this. to initialize a field, then the type of the parameter is understood to be the same type as the field.

GOOD:

class Point {
  int x, y;
  Point(this.x, this.y);
}

BAD:

class Point {
  int x, y;
  Point(int this.x, int this.y);
}

Metadata

Metadata

Assignees

Labels

devexp-linterIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.type-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