Skip to content

Allow Future.then callbacks to be nullary #22241

Closed
@DartBot

Description

@DartBot

This issue was originally filed by @seaneagan


Instead of:

  action().then((_) => handleCompletion());

I want to do:

  action().then(handleCompletion);

Future.then would just need to do an is check on the arity. It could be a separate e.g. then0 method, but that would not be quite as nice UX.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-asynctype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions