We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Symbol.iterator
never
yield*
iteration yield iterator symbol generic call inference
https://www.typescriptlang.org/play/?ts=5.9.0-dev.20250228#code/CYUwxgNghgTiAEYD2A7AzgF3gSxSkMAXPAN4BQ88APAIIB8AFAG5QQCuIxNAlMeZZQa94NANwUBAbQDKATwC2AIyQQAdNgwEoGJDAC6QvhIHx8ADwwNV12AHM0xAEogowVBFk0YMKLKpQUWTphAElNHx0YZzQ2CAx-QIAaETpxEwBfNPhMshyyUEhYBAAzNhQwDGxUeCQ2cNpGZWBZYmZWDi5ueABeOngAcRB8CN0E2WSA8fhJ4OImJGxgcTJa8IZS8srUACpqABVGFnZOeD2u-kRUTHg4GLie+FlsEAhgXdxhtuPuUXgAej+8AIMF0AH5cj8yCs6gR1mUKlUULsqAcvh1TucJMh0FgzA8PrCjhxIZRsddbrEsN1Hs9XrszL8ATUANYQ0RAA
declare const inner: { <A>(value: A): { (): A; [Symbol.iterator](): { next(...args: ReadonlyArray<any>): IteratorResult<any, A>; }; }; }; declare function outer<A>(body: (value: A) => Generator<any, any, any>): void; outer(function* <T>(value: T) { const result = yield* inner(value); // error? }); outer(function* <T>(value: T) { const x = inner(value); const result = yield* x; // ok });
It errors on the first inner call with a spurious error
inner
it shouldn't error, both calls to inner are the same here - the second one that happens outside of the yield* context works just OK
This signature is crafted based on the problem diagnosis. The original issue can be seen in a better example here: TS playground
The text was updated successfully, but these errors were encountered:
silentNeverType
Successfully merging a pull request may close this issue.
π Search Terms
iteration yield iterator symbol generic call inference
π Version & Regression Information
β― Playground Link
https://www.typescriptlang.org/play/?ts=5.9.0-dev.20250228#code/CYUwxgNghgTiAEYD2A7AzgF3gSxSkMAXPAN4BQ88APAIIB8AFAG5QQCuIxNAlMeZZQa94NANwUBAbQDKATwC2AIyQQAdNgwEoGJDAC6QvhIHx8ADwwNV12AHM0xAEogowVBFk0YMKLKpQUWTphAElNHx0YZzQ2CAx-QIAaETpxEwBfNPhMshyyUEhYBAAzNhQwDGxUeCQ2cNpGZWBZYmZWDi5ueABeOngAcRB8CN0E2WSA8fhJ4OImJGxgcTJa8IZS8srUACpqABVGFnZOeD2u-kRUTHg4GLie+FlsEAhgXdxhtuPuUXgAej+8AIMF0AH5cj8yCs6gR1mUKlUULsqAcvh1TucJMh0FgzA8PrCjhxIZRsddbrEsN1Hs9XrszL8ATUANYQ0RAA
π» Code
π Actual behavior
It errors on the first
inner
call with a spurious errorπ Expected behavior
it shouldn't error, both calls to
inner
are the same here - the second one that happens outside of theyield*
context works just OKAdditional information about the issue
This signature is crafted based on the problem diagnosis. The original issue can be seen in a better example here: TS playground
The text was updated successfully, but these errors were encountered: