Skip to content

Clarify overridden_fields lint documentation - #63788

Open
gingerninja85 wants to merge 1 commit into
dart-lang:mainfrom
gingerninja85:docs/clarify-overridden-fields
Open

Clarify overridden_fields lint documentation#63788
gingerninja85 wants to merge 1 commit into
dart-lang:mainfrom
gingerninja85:docs/clarify-overridden-fields

Conversation

@gingerninja85

Copy link
Copy Markdown

Clarifies the published documentation for the overridden_fields lint.

The issue discussion notes a common misconception: users may think overriding a field just changes the superclass field's initializer. This adds a short explanation that the subclass field is a separate storage location and does not replace or reinitialize the superclass field.

Fixes #58311.


  • I’ve reviewed the contributor guide and applied the relevant portions to this PR.

Validation:

  • Parsed pkg/linter/messages.yaml with PyYAML successfully.
  • Ran git diff --check successfully.

Note: I could not run the Dart linter/doc generation tests in this shallow GitHub clone because this environment does not have a Dart SDK binary or the full gclient fetch checkout required by CONTRIBUTING.md.

Explain that overriding a field with another field does not replace the superclass field or change its initializer; it creates a separate storage location.

Fixes dart-lang#58311.
@google-cla

google-cla Bot commented Jul 9, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@copybara-service

Copy link
Copy Markdown

Thank you for your contribution! This project uses Gerrit for code reviews. Your pull request has automatically been converted into a code review at:

https://dart-review.googlesource.com/c/sdk/+/522400

Please wait for a developer to review your code review at the above link; you can speed up the review if you sign into Gerrit and manually add a reviewer that has recently worked on the relevant code. See CONTRIBUTING.md to learn how to upload changes to Gerrit directly.

Additional commits pushed to this PR will update both the PR and the corresponding Gerrit CL. After the review is complete on the CL, your reviewer will merge the CL (automatically closing this PR).

@copybara-service

Copy link
Copy Markdown

Gerrit CL has been approved, please wait for a reviewer to merge it.

There are also new comments on the CL, please review them and respond if necessary because reviewer might have requested clarifications or possibly some final changes and will not merge the CL until their questions have been answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

overridden_fields documentation is vague

1 participant