-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert "linter: Refactor prefer_collection_literals to use co…
…ntext type more"" This reverts commit cbdae14. In addition, Fix prefer_collection_literals for methods with expression bodies Original description: linter: Refactor prefer_collection_literals to use context type more There is a basic premise in this rule which we cannot satisfy exactly: we need to disallow `LinkedHashSet()` unless the context type requires the developer to use `LinkedHashSet`. But the context type is long gone when the lint rule is run. This CL adds some logic to try to attempt figuring out the context type in the cases where users have filed bugs, but it will never be super accurate. Fixes https://github.com/dart-lang/linter/issues/4736 Fixes https://github.com/dart-lang/linter/issues/3057 Fixes https://github.com/dart-lang/linter/issues/1649 Fixes https://github.com/dart-lang/linter/issues/2795 Change-Id: I958ba69a56866c18523ce6cbf62645ef8e028f6b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/324260 Commit-Queue: Samuel Rawlins <[email protected]> Reviewed-by: Konstantin Shcheglov <[email protected]>
- Loading branch information
Showing
5 changed files
with
294 additions
and
93 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.