dart-lang / dart-lang/language

Problem: Wrapping functions and forwarding arguments is noisy

Open
#157 13 comments 11 reactions 0 assignees View on GitHub
Dominant language
TeX
Stars
2.9k
Forks
239
Avg merge
2d 18h
Merged PRs (30d)
14

Description

It's not possible to write a signature expressing that the return value is a function having the same argument count and types as one of the parameters. This leads to ugly blocks where we define the same function N times with varying argument counts and lots of duplication in generic types and forwarding the arguments.

For example `expectAsync0` through `expectAsync6`: https://github.com/dart-lang/test/blob/ac21330338e0a7ad68fb19058bb92260706dd6cf/pkgs/test_api/lib/src/frontend/expect_async.dart#L295

This gets even more complex with things like optional arguments.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.