Repository navigation
Add proposal to drop support for the old function syntax - #4782
Merged
Merged
Conversation
- Function-typed parameters. - Function type typedefs.
This was referenced Sep 28, 2026
albertms10
reviewed
Sep 28, 2026
lrhn
approved these changes
Sep 29, 2026
eernstg
approved these changes
Sep 30, 2026
eernstg
left a comment
Member
There was a problem hiding this comment.
This is great! In addition to getting this done, it serves as a reminder why we really want to do this. ;-)
LGTM
copybara-service Bot
pushed a commit
to dart-lang/sdk
that referenced
this pull request
Sep 30, 2026
We have had a core lint for over five years encouraging users to move away from the old function typedef syntax to the new generalized typedef syntax. We should probably take our own advice. This is particularly relevant to: dart-lang/language#4782 But even if we don't remove support for the old syntax, our own code should still be idiomatic. Also enabled the lint in the packages where I could. This CL does not fix uses of the old typedefs in generated web libraries. I'll fix the generator and send out a separate CL for that after this lands: https://dart-review.googlesource.com/c/sdk/+/557020 TEST=Purely mechanical syntax change CoreLibraryReviewExempt: Purely mechanical syntax change Change-Id: I94fa1ec73f0ea5b6c8a0dece4f903b12852052d2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/556942 Auto-Submit: Bob Nystrom <[email protected]> Reviewed-by: Alexander Aprelev <[email protected]> Commit-Queue: Bob Nystrom <[email protected]> Reviewed-by: Lasse Nielsen <[email protected]> Reviewed-by: Johnni Winther <[email protected]>
munificent
added a commit
to dart-lang/dartdoc
that referenced
this pull request
Oct 21, 2026
When Dartdoc generates documentation for a function with a parameter whose type is a function type (i.e. a callback), the generated docs use the old pre-Dart-2.0 function-typed parameter syntax. Dartdoc does this even if the function itself uses the newer syntax. For over five years, we have had a recommended lint telling users not to use the old function-typed parameter syntax. Newer Dart users may not be familiar with it at all. Our generated docs should probably use the same syntax that we recommend that users write. :) Also, I am working on a proposal to drop support for the old function-typed parameter syntax completely. If that happens, then we should definitely stop using the old non-existent syntax. (See dart-lang/language#4782). This obviously affects the output of Dartdoc pretty significantly, so I'm not sure what landing this entails, but I figured I'd put together a PR and send it out to start that discussion. If now is not the right time to make a change like this, that's OK too, but I do think we should make this change at some point. Fix #3671.
sgrekhov
pushed a commit
to sgrekhov/dartdoc
that referenced
this pull request
Oct 22, 2026
When Dartdoc generates documentation for a function with a parameter whose type is a function type (i.e. a callback), the generated docs use the old pre-Dart-2.0 function-typed parameter syntax. Dartdoc does this even if the function itself uses the newer syntax. For over five years, we have had a recommended lint telling users not to use the old function-typed parameter syntax. Newer Dart users may not be familiar with it at all. Our generated docs should probably use the same syntax that we recommend that users write. :) Also, I am working on a proposal to drop support for the old function-typed parameter syntax completely. If that happens, then we should definitely stop using the old non-existent syntax. (See dart-lang/language#4782). This obviously affects the output of Dartdoc pretty significantly, so I'm not sure what landing this entails, but I figured I'd put together a PR and send it out to start that discussion. If now is not the right time to make a change like this, that's OK too, but I do think we should make this change at some point. Fix dart-lang#3671.
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.
Removes: