Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 13.7k
Improve type checking and inference for Generators and Async Generators#30790
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
14f586239dc1091cc57b8bd6dacec946784314a82a200106477a1232293d39740210bbcd2c857f403f0827ddbb3222792dfaefd005f94886File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -8,15 +8,23 @@ interface SymbolConstructor { | ||
| readonly iterator: symbol; | ||
| } | ||
| interface IteratorResult<T> { | ||
| done: boolean; | ||
| value: T; | ||
| interface IteratorYieldResult<TYield> { | ||
| done?: false; | ||
| value: TYield; | ||
| } | ||
| interface Iterator<T> { | ||
| next(value?: any): IteratorResult<T>; | ||
| return?(value?: any): IteratorResult<T>; | ||
| throw?(e?: any): IteratorResult<T>; | ||
| interface IteratorReturnResult<TReturn> { | ||
rbuckton marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| done: true; | ||
| value: TReturn; | ||
| } | ||
| type IteratorResult<T, TReturn = any> = IteratorYieldResult<T> | IteratorReturnResult<TReturn>; | ||
| interface Iterator<T, TReturn = any, TNext = undefined> { | ||
sandersn marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| // NOTE: 'next' is defined using a tuple to ensure we report the correct assignability errors in all places. | ||
| next(...args: [] | [TNext]): IteratorResult<T, TReturn>; | ||
| return?(value?: TReturn): IteratorResult<T, TReturn>; | ||
| throw?(e?: any): IteratorResult<T, TReturn>; | ||
| } | ||
| interface Iterable<T> { | ||
rbuckton marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.