Repository navigation
Fix Diagnostics subclasses that had the wrong default value for the named parameter. - #50645
Merged
Merged
Conversation
Contributor
Author
|
@pq it would be great if there was a lint that warned if a subclass used a different default value for a named parameter than the base class. I can't think of many cases where using a different default value in a subclass is intentional. Having a different default value makes the default value shown in the base API very misleading. |
Contributor
Author
|
Fixed a few missing lint warnings about subclasses with mismatched defaults. I was a bit confused in the original CL description. DiagnosticsNode had the right default value for the toString but DiagnosticableMixin did not which was why the existing lint for named parameters didn't catch this case. |
gspencergoog
approved these changes
Feb 12, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

…
Description
the toString method for the base class used the correct default value of
DiagnosticLevel.infobut a couple subclasses accidentally used the wrong default.Related Issues
#50644
Tests
I added the following tests:
Added a regression test for this issue in diagnostics_test.dart
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read [Handling breaking changes].