dart-lang / dart-lang/language

Allow both optional positional and named parameters in the same function signature

Open
#1,076 53 comments 254 reactions 0 assignees View on GitHub
request
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.