FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow specifying TReturn and TNext for AsyncIterableIterator and AsyncIterable by bterlson · Pull Request #36723 · microsoft/TypeScript · GitHub

Allow specifying TReturn and TNext for AsyncIterableIterator and AsyncIterable - #36723

Closed
Brian Terlson (bterlson) wants to merge 2 commits into
microsoft:mainfrom
bterlson:plumb-tnext
Closed

Allow specifying TReturn and TNext for AsyncIterableIterator and AsyncIterable#36723
Brian Terlson (bterlson) wants to merge 2 commits into
microsoft:mainfrom
bterlson:plumb-tnext

Conversation

Brian Terlson (bterlson) commented Feb 10, 2020
edited
Loading

Copy link
Copy Markdown
Member

Partially fixes #33932 by giving a way to provide a better type than any for TReturn. Implementation is simply adding and plumbing the TReturn and TNext parameters for both AsyncIterableIterator and AsyncIterable, and updating baselines.

Copy link
Copy Markdown
Member

TypeScript Bot (typescript-bot) commented Feb 13, 2020
edited
Loading

Copy link
Copy Markdown
Contributor

Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the extended test suite on this PR at 3b69bf2. You can monitor the build here. It should now contribute to this PR's status checks.

TypeScript Bot (typescript-bot) commented Feb 13, 2020
edited
Loading

Copy link
Copy Markdown
Contributor

Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the parallelized Definitely Typed test suite on this PR at 3b69bf2. You can monitor the build here. It should now contribute to this PR's status checks.

TypeScript Bot (typescript-bot) commented Feb 13, 2020
edited
Loading

Copy link
Copy Markdown
Contributor

Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the parallelized community code test suite on this PR at 3b69bf2. You can monitor the build here. It should now contribute to this PR's status checks.

Copy link
Copy Markdown
Contributor

The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master.

Copy link
Copy Markdown
Member Author

TypeScript Bot (typescript-bot) commented Feb 13, 2020
edited
Loading

Copy link
Copy Markdown
Contributor

Heya Brian Terlson (@bterlson), I've started to run the parallelized Definitely Typed test suite on this PR at aa0f332. You can monitor the build here. It should now contribute to this PR's status checks.

TypeScript Bot (typescript-bot) commented Feb 13, 2020
edited
Loading

Copy link
Copy Markdown
Contributor

Heya Brian Terlson (@bterlson), I've started to run the parallelized community code test suite on this PR at aa0f332. You can monitor the build here. It should now contribute to this PR's status checks.

TypeScript Bot (typescript-bot) commented Feb 13, 2020
edited
Loading

Copy link
Copy Markdown
Contributor

Heya Brian Terlson (@bterlson), I've started to run the extended test suite on this PR at aa0f332. You can monitor the build here. It should now contribute to this PR's status checks.

Nathan Shively-Sanders (sandersn) added the For Milestone Bug PRs that fix a bug with a specific milestone label Feb 13, 2020

ExE Boss (ExE-Boss) commented Feb 15, 2020
edited
Loading

Copy link
Copy Markdown
Contributor

What about Iterable and IterableIterator?

Also, do note that this was originally rejected in #30790 (comment) by Ron Buckton (@rbuckton).

Copy link
Copy Markdown
Member Author

ExE Boss (@ExE-Boss) I would argue for similar treatment, but given Ron Buckton (@rbuckton)'s trepidation I think we should wait and see what he thinks. If adding Iterable and IterableIterator to this PR would help, I will do it!

Ron Buckton (rbuckton) commented Jul 30, 2020
edited
Loading

Copy link
Copy Markdown
Contributor

At one point in #30790 I was using unknown instead of any. The problem with undefined as a default is that not every Iterator can be assumed to return undefined, and making the type anything other than any or unknown caused a significant number of breaks in assignability where people were rolling their own custom iterators.

We also had issues with the fact that we were conflating T in Iterator and Iterable to include both the yielded and the returned type, and the fact that Iterator<T> was originally typed with return?(value?: any):

I am considering my concerns about adding TReturn and TNext to Iterable. My main concern is that it would dramatically increase .d.ts file output if suddenly every inferred Iterable<number> in the output became Iterable<number, void, undefined> because we fill in the default types at the time of compilation.

Copy link
Copy Markdown
Member

Unfortunately, we never finished reviewing this PR. It is pretty old now, so I'm going to close it to reduce the number of open PRs.

Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Milestone Bug PRs that fix a bug with a specific milestone

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Iterator result of Iterable or AsyncIterable inferred to any

6 participants


Back | FazBrowse Home | New Git URL