Repository navigation
Swap the arguments to has - #2758
Merged
Merged
Conversation
Towards #2616 These were originally written with the callback argument first because it adds a slight convenience in an IDE where the fields can be autocompleted before having to type the name argument. It's more common in Dart for the callback argument to be trailing, and it reads nicer with the name argument first. Add fix data to correct use sites. Update the code generator to use the new format.
PR HealthPublish ✔️
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. This check can be disabled by tagging the PR with Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. This check can be disabled by tagging the PR with |
lrhn
approved these changes
Sep 23, 2026
natebosch
added a commit
that referenced
this pull request
Oct 28, 2026
Towards #2616 Landing ahead of #2758 Add a `has2` extension method on `Subject` which takes the `name` argument before the `extract` callback. This is the argument order that `has` will eventually use. It's more common in Dart for a callback argument to be trailing, and it reads better with the name first. This package needs to roll to mono repos where an atomic fix to usage sites is more brittle than incremental fixes. Instead of swapping the arguments to `has` in one breaking change, roll this version and migrate usages to `has2`. Then swap the arguments to `has`, migrate usages back, and remove `has2`. All of these steps will land before the next publish to pub. Migrate usages in this repo to `has2`, and update the `checks_codegen` builder to generate `has2` calls.
brianquinlan
approved these changes
Nov 3, 2026
| @@ -0,0 +1,45 @@ | |||
| version: 1 | |||
Contributor
There was a problem hiding this comment.
This is a new one for me!
copybara-service Bot
pushed a commit
to dart-lang/sdk
that referenced
this pull request
Nov 13, 2026
Revisions updated by `dart tools/rev_sdk_deps.dart`. dartdoc (https://github.com/dart-lang/dartdoc/compare/7e2508c..1c40672): 1c406729 Thu Nov 12 10:21:44 2026 +0200 Sergey G. Grekhov Add method doc comment tests for mixin, enums, extension and extension types (dart-lang/dartdoc#4317) 37781f73 Thu Nov 12 10:21:17 2026 +0200 Sergey G. Grekhov Add operator doc comment tests for mixin, enums, extension and extension types (dart-lang/dartdoc#4318) native (https://github.com/dart-lang/native/compare/b21ef2d..5fcc6f4): 5fcc6f4f2 Fri Nov 13 10:15:54 2026 +1100 Liam Appelbe [jni] Fix doc typo (dart-lang/native#3792) test (https://github.com/dart-lang/test/compare/3533ae1..269bdfd): 269bdfde Thu Nov 12 17:06:39 2026 -0800 Nate Bosch Swap the arguments to `has` (dart-lang/test#2758) tools (https://github.com/dart-lang/tools/compare/589d844..ddda9d8): ddda9d89d Thu Nov 12 20:52:40 2026 +0200 NemesisDev [unified_analytics] Add fallbackRootTool to getEnvironment() (dart-lang/tools#2806) e4082a359 Thu Nov 12 15:50:08 2026 +0100 Jonas Finnemann Jensen [markdown] Cap synthetic empty table cells at 0x40000 (dart-lang/tools#2816) Change-Id: I87a785700abdb687cc74e643d95baf1e068f993b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/577800 Reviewed-by: Kevin Moore <[email protected]> Commit-Queue: Kevin Moore <[email protected]> Commit-Queue: Nate Bosch <[email protected]> Auto-Submit: Nate Bosch <[email protected]>
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.
Towards #2616
These were originally written with the callback argument first because
it adds a slight convenience in an IDE where the fields can be
autocompleted before having to type the name argument. It's more common
in Dart for the callback argument to be trailing, and it reads nicer
with the name argument first.
Add fix data to correct use sites. Migrate
has2call sites inchecksand
checks_codegenback tohas, and keephas2forwarding tohasuntil downstream
has2callers are migrated.