Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Bracketless lambda argument #44591

Closed
FiercestT opened this issue Jan 6, 2021 · 3 comments
Closed

Feature Request: Bracketless lambda argument #44591

FiercestT opened this issue Jan 6, 2021 · 3 comments

Comments

@FiercestT
Copy link

FiercestT commented Jan 6, 2021

Currently when writing an anonymous function with a lambda, I've noticed that even with only one argument, we are forced to enclose the argument in brackets.

E.g.

someFuture.then((oneArg) => doSomething(oneArg));
someFuture.then((l) => doSomething(l));

It would be simple and nice QOL if we could do it like:

someFuture.then(oneArg => doSomething(oneArg));
someFuture.then(l => doSomething(l));

Java supports this and makes it a bit less of a brackety mess.
I'm not sure if there's some other technical feature blocking this feature being added.

Thanks!

@julemand101
Copy link
Contributor

This sounds more like a change to the language specification which has its own repository: https://github.com/dart-lang/language/issues

@eernstg
Copy link
Member

eernstg commented Jan 6, 2021

Also note existing proposals: This one is nearly a duplicate of dart-lang/language#320, and it is related to dart-lang/language#265.

@mit-mit
Copy link
Member

mit-mit commented Jan 6, 2021

Yes, closing as a duplicate of dart-lang/language#320

@mit-mit mit-mit closed this as completed Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants