Clarify overridden_fields lint documentation - #63788
Conversation
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.
|
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. |
|
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). |
|
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. |
Clarifies the published documentation for the
overridden_fieldslint.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.
Validation:
pkg/linter/messages.yamlwith PyYAML successfully.git diff --checksuccessfully.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 fetchcheckout required byCONTRIBUTING.md.