-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Milestone
Description
π Search Terms
yield ts2488 never iterator
π Version & Regression Information
- This changed between versions 3.5.1 and 3.6.2
every-ts bisect gives: e8bf958 is the first bad commit
β― Playground Link
π» Code
declare function fn<T>(value: () => T): { (): T };
declare function fn<T>(value: T): Iterable<unknown>;
export class A {
a = fn(function* (this: A) {
yield* fn(1); // error
});
b = fn(function* (this: A) {
const temp = fn(1); // ok
yield* temp;
});
}
π Actual behavior
src/error.ts:6:16 - error TS2488: Type 'never' must have a '[Symbol.iterator]()' method that returns an iterator.
6 yield* fn(1);
~~~~~
π Expected behavior
No error, as in A.b
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.