google / google/closure-compiler

Update Iterator and related classes to have 3 template parameters

Open
#3,489 2 comments 0 reactions 0 assignees View on GitHub
internal-issue-created
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

Currently `Iterator` and related types have only a single template parameter, which is interpreted as both the type yielded and the final return type.

This has never really been sufficient, because the return type is allowed to be different from the yielded type for a generator, and also you can pass values to the `next()` method that then end up as the result of the `yield` expression inside the generator, and it would be better if we type checked those also.

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.