Allow trailing required positional parameters #22136
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
closed-duplicate
Closed in favor of an existing report
type-enhancement
A request for a change that isn't a bug
This issue was originally filed by @seaneagan
Problem: It's much more readable to pass callbacks as the last argument to a function call so as not to bury other args behind a long code block. But that's not currently possible if:
since optional args must go after positional args.
Either of issue #4188 or issue #15398 would solve this problem for when the optional args are named.
But the following proposal (this issue) solves this problem for when the optionals are positional:
Allow trailing required positional parameters:
The best we can currently do is:
which:
The text was updated successfully, but these errors were encountered: