dart-lang / dart-lang/language
Allow both optional positional and named parameters in the same function signature
- Dominant language
- TeX
- Stars
- 2.9k
- Forks
- 239
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 14
Description
Dart functions currently can have only either optional named parameters or optional positional parameters, but not both.
While developing libraries repeatedly run into cases where this restriction gets in the way of the signature we want.
It would be preferable if you could have both kinds of parameters on the same function.
The only syntax change necessary is to the declaration of functions. The call syntax is unaffected, and so is noSuchMethod/Function.apply.
Contributor guide
Research direction
Start by reviewing the function-declaration syntax described in the issue, focusing on how optional named and optional positional parameters would coexist. Then check the stated unaffected areas, including call syntax, noSuchMethod, and Function.apply. Done means producing and validating a language-design change that resolves the restriction without changing those call mechanisms.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 20/100